aboutsummaryrefslogtreecommitdiff
path: root/tests/server/getpart.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-02-22 10:40:05 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-02-22 10:40:05 +0000
commit7d043f46d56d07062da64c6eb32f8b1c0c301c26 (patch)
tree9af2e299ee9afe05bbef16cd839456458d6e5c7f /tests/server/getpart.c
parentcbca19d6c2db44060c99ad502dd42ffc07f13037 (diff)
hide debug output from screen, use log/ for logfiles
Diffstat (limited to 'tests/server/getpart.c')
-rw-r--r--tests/server/getpart.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
index e044f5b5d..108d536af 100644
--- a/tests/server/getpart.c
+++ b/tests/server/getpart.c
@@ -7,6 +7,12 @@
#define EAT_SPACE(ptr) while( ptr && *ptr && isspace(*ptr) ) ptr++
#define EAT_WORD(ptr) while( ptr && *ptr && !isspace(*ptr) && ('>' != *ptr)) ptr++
+#ifdef DEBUG
+#define show(x) printf x
+#else
+#define show(x)
+#endif
+
char *appendstring(char *string, /* original string */
char *buffer, /* to append */
int *stringlen, int *stralloc)
@@ -60,9 +66,9 @@ char *spitout(FILE *stream, char *main, char *sub, int *size)
if('<' != *ptr) {
if(display) {
- printf("=> %s", buffer);
+ show(("=> %s", buffer));
string = appendstring(string, buffer, &stringlen, &stralloc);
- printf("* %s\n", buffer);
+ show(("* %s\n", buffer));
}
continue;
}
@@ -113,17 +119,17 @@ char *spitout(FILE *stream, char *main, char *sub, int *size)
}
if(display) {
string = appendstring(string, buffer, &stringlen, &stralloc);
- printf("* %s\n", buffer);
+ show(("* %s\n", buffer));
}
if((STATE_INSUB == state) &&
!strcmp(cmain, main) &&
!strcmp(csub, sub)) {
- printf("* (%d bytes) %s\n", stringlen, buffer);
+ show(("* (%d bytes) %s\n", stringlen, buffer));
display = 1; /* start displaying */
}
else {
- printf("%d (%s/%s): %s\n", state, cmain, csub, buffer);
+ show(("%d (%s/%s): %s\n", state, cmain, csub, buffer));
display = 0; /* no display */
}
}