mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
made one of the changes suggested by Brian Krahmer allow to pass '--' on
* debugXML.c: made one of the changes suggested by Brian Krahmer * testRegexp.c: allow to pass '--' on the command line to allow regexps starting with the character '-' Daniel svn path=/trunk/; revision=3697
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Thu Feb 21 22:46:08 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* debugXML.c: made one of the changes suggested by Brian Krahmer
|
||||||
|
* testRegexp.c: allow to pass '--' on the command line to allow
|
||||||
|
regexps starting with the character '-'
|
||||||
|
|
||||||
Tue Feb 19 08:49:32 CET 2008 Daniel Veillard <daniel@veillard.com>
|
Tue Feb 19 08:49:32 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* python/Makefile.am python/tests/Makefile.am: applied cleanup
|
* python/Makefile.am python/tests/Makefile.am: applied cleanup
|
||||||
|
@ -3244,6 +3244,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
|
|||||||
"Unknown command %s\n", command);
|
"Unknown command %s\n", command);
|
||||||
}
|
}
|
||||||
free(cmdline); /* not xmlFree here ! */
|
free(cmdline); /* not xmlFree here ! */
|
||||||
|
cmdline = NULL;
|
||||||
}
|
}
|
||||||
#ifdef LIBXML_XPATH_ENABLED
|
#ifdef LIBXML_XPATH_ENABLED
|
||||||
xmlXPathFreeContext(ctxt->pctxt);
|
xmlXPathFreeContext(ctxt->pctxt);
|
||||||
|
19
testRegexp.c
19
testRegexp.c
@ -290,6 +290,9 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
if (argv[i][0] != '-')
|
if (argv[i][0] != '-')
|
||||||
continue;
|
continue;
|
||||||
|
if (!strcmp(argv[i], "--"))
|
||||||
|
break;
|
||||||
|
|
||||||
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) {
|
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) {
|
||||||
debug++;
|
debug++;
|
||||||
} else if ((!strcmp(argv[i], "-repeat")) ||
|
} else if ((!strcmp(argv[i], "-repeat")) ||
|
||||||
@ -322,10 +325,15 @@ int main(int argc, char **argv) {
|
|||||||
#endif
|
#endif
|
||||||
testRegexpFile(filename);
|
testRegexpFile(filename);
|
||||||
} else {
|
} else {
|
||||||
|
int data = 0;
|
||||||
#ifdef LIBXML_EXPR_ENABLED
|
#ifdef LIBXML_EXPR_ENABLED
|
||||||
|
|
||||||
if (use_exp) {
|
if (use_exp) {
|
||||||
for (i = 1; i < argc ; i++) {
|
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) {
|
if (pattern == NULL) {
|
||||||
pattern = argv[i];
|
pattern = argv[i];
|
||||||
printf("Testing expr %s:\n", pattern);
|
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);
|
xmlExpFree(ctxt, expr);
|
||||||
|
expr = NULL;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
for (i = 1; i < argc ; i++) {
|
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) {
|
if (pattern == NULL) {
|
||||||
pattern = argv[i];
|
pattern = argv[i];
|
||||||
printf("Testing %s:\n", pattern);
|
printf("Testing %s:\n", pattern);
|
||||||
|
Reference in New Issue
Block a user