From 33bea767ebd0bbf11867fe1af31dc345e9f816af Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 23 Jan 2007 02:25:56 +0000 Subject: Convert (most of) the test data files into genuine XML. A handful still are not, due mainly to the lack of support for XML character entities (e.g. & => & ). This will make it easier to validate test files using tools like xmllint, as well as edit and view them using XML tools. --- tests/server/getpart.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/server') diff --git a/tests/server/getpart.c b/tests/server/getpart.c index 5a839b122..3453bf313 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -120,6 +120,7 @@ const char *spitout(FILE *stream, enum { STATE_OUTSIDE, + STATE_OUTER, STATE_INMAIN, STATE_INSUB, STATE_ILLEGAL @@ -173,6 +174,10 @@ const char *spitout(FILE *stream, cmain[0]=0; /* no main anymore */ display=0; } + else if(state == STATE_OUTER) { + /* this is the end of the outermost file section */ + state--; + } } else if(!display) { /* this is the beginning of a section */ @@ -182,6 +187,10 @@ const char *spitout(FILE *stream, *end = 0; switch(state) { case STATE_OUTSIDE: + /* Ignore the outermost element */ + state = STATE_OUTER; + break; + case STATE_OUTER: strcpy(cmain, ptr); state = STATE_INMAIN; break; @@ -214,6 +223,10 @@ 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 */ + state--; + } else { show(("%d (%s/%s): %s\n", state, cmain, csub, buffer)); display = 0; /* no display */ -- cgit v1.2.3