summaryrefslogtreecommitdiff
path: root/tests/server/getpart.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-01-23 20:24:26 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-01-23 20:24:26 +0000
commitf68323da7d24872650af5c8c1823b1f8ae821c1f (patch)
tree7a510e50a4347cc25adb61841a8e201be5f1521d /tests/server/getpart.c
parenta61aafa325cb1f20d15264aee07e91c391e307f3 (diff)
downloadcurl-f68323da7d24872650af5c8c1823b1f8ae821c1f.tar.gz
Ignore XML DOCTYPEs and declarations.
Diffstat (limited to 'tests/server/getpart.c')
-rw-r--r--tests/server/getpart.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
index 3453bf313..b66281aeb 100644
--- a/tests/server/getpart.c
+++ b/tests/server/getpart.c
@@ -187,7 +187,9 @@ const char *spitout(FILE *stream,
*end = 0;
switch(state) {
case STATE_OUTSIDE:
- /* Ignore the outermost <testcase> element */
+ /* Skip over the outermost element (<testcase>), but if it turns out
+ to be a comment, completely ignore it below */
+ strcpy(cmain, ptr);
state = STATE_OUTER;
break;
case STATE_OUTER:
@@ -206,7 +208,7 @@ const char *spitout(FILE *stream,
/* There might be attributes here. Check for those we know of and care
about. */
if(strstr(&end[1], "base64=")) {
- /* rought and dirty, but "mostly" functional */
+ /* rough and dirty, but "mostly" functional */
/* Treat all data as base64 encoded */
base64 = 1;
}
@@ -223,8 +225,9 @@ const char *spitout(FILE *stream,
show(("* (%d bytes) %s\n", stringlen, buffer));
display = 1; /* start displaying */
}
- else if ((*cmain == '!') || (*csub == '!')) {
- /* This is just a comment, not a new section */
+ else if ((*cmain == '?') || (*cmain == '!') || (*csub == '!')) {
+ /* Ignore comments, DOCTYPEs and XML declarations */
+ show(("%d ignoring (%s/%s)\n", state, cmain, csub));
state--;
}
else {