aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-09-06 13:27:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-09-06 13:27:18 +0000
commite8635044b58ff0fb93465758e70867428bd4cc1b (patch)
treea5eb93df68b937e8e84879231523ea44447d9bf3 /src
parent56dea0ac9a8906cf5fe2a87d06efedcfcf7ccaa5 (diff)
Now curl warns if an unknown variable is used in the -w/--writeout argument.
Diffstat (limited to 'src')
-rw-r--r--src/writeout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/writeout.c b/src/writeout.c
index 99a95ae36..d3c246c51 100644
--- a/src/writeout.c
+++ b/src/writeout.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -112,11 +112,13 @@ void ourWriteOut(CURL *curl, char *writeinfo)
char keepit;
int i;
if(('{' == ptr[1]) && (end=strchr(ptr, '}'))) {
+ bool match = FALSE;
ptr+=2; /* pass the % and the { */
keepit=*end;
*end=0; /* zero terminate */
for(i=0; replacements[i].name; i++) {
if(curl_strequal(ptr, replacements[i].name)) {
+ match = TRUE;
switch(replacements[i].id) {
case VAR_EFFECTIVE_URL:
if((CURLE_OK ==
@@ -217,6 +219,9 @@ void ourWriteOut(CURL *curl, char *writeinfo)
break;
}
}
+ if(!match) {
+ fprintf(stderr, "curl: unknown --writeout variable: '%s'\n", ptr);
+ }
ptr=end+1; /* pass the end */
*end = keepit;
}