summaryrefslogtreecommitdiff
path: root/testRegexp.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2008-04-09 10:33:41 +0200
committerMike Hommey <glandium@debian.org>2008-04-09 10:33:41 +0200
commit88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d (patch)
treee12ef38cd8eb205c495e5718852d758b95e3a3c6 /testRegexp.c
parentfc760252aba4054a612dd20b803d0c7c19713064 (diff)
downloadlibxml2-88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d.tar.gz
Load /tmp/libxml2-2.6.32 intoupstream/2.6.32.dfsg
libxml2/branches/upstream/current.
Diffstat (limited to 'testRegexp.c')
-rw-r--r--testRegexp.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/testRegexp.c b/testRegexp.c
index d5228b3..626536e 100644
--- a/testRegexp.c
+++ b/testRegexp.c
@@ -290,6 +290,9 @@ int main(int argc, char **argv) {
if (argv[i][0] != '-')
continue;
+ if (!strcmp(argv[i], "--"))
+ break;
+
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) {
debug++;
} else if ((!strcmp(argv[i], "-repeat")) ||
@@ -322,10 +325,15 @@ int main(int argc, char **argv) {
#endif
testRegexpFile(filename);
} else {
+ int data = 0;
#ifdef LIBXML_EXPR_ENABLED
+
if (use_exp) {
for (i = 1; i < argc ; i++) {
- if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
+ if (strcmp(argv[i], "--") == 0)
+ data = 1;
+ else if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0) ||
+ (data == 1)) {
if (pattern == NULL) {
pattern = argv[i];
printf("Testing expr %s:\n", pattern);
@@ -342,13 +350,18 @@ int main(int argc, char **argv) {
}
}
}
- if (expr != NULL)
+ if (expr != NULL) {
xmlExpFree(ctxt, expr);
+ expr = NULL;
+ }
} else
#endif
{
for (i = 1; i < argc ; i++) {
- if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
+ if (strcmp(argv[i], "--") == 0)
+ data = 1;
+ else if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0) ||
+ (data == 1)) {
if (pattern == NULL) {
pattern = argv[i];
printf("Testing %s:\n", pattern);