aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-08-12 21:25:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-08-12 21:25:44 +0000
commit639857ceb2450e6bf8fd0c21203b1c01f07eed9e (patch)
treef7211ce015b81a4a647bf1cc4679145220e269b6 /src
parent162f58c53ce51375f444e9870246206eb9af650f (diff)
o curl -d @filename when 'filename' was not possible to access no longer
converts the request to a GET, but now instead makes it a POST of no data o The time condition illegal syntax warning is now inhibited if -s is used.
Diffstat (limited to 'src')
-rw-r--r--src/main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 608b86afe..26b95a656 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1749,8 +1749,15 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
postdata = file2memory(file, &config->postfieldsize);
else
postdata = file2string(file);
+
if(file && (file != stdin))
fclose(file);
+
+ if(!postdata) {
+ /* no data from the file, point to a zero byte string to make this
+ get sent as a POST anyway */
+ postdata=strdup("");
+ }
}
else {
GetStr(&postdata, nextarg);
@@ -2205,10 +2212,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
if(-1 == stat(nextarg, &statbuf)) {
/* failed, remove time condition */
config->timecond = CURL_TIMECOND_NONE;
- fprintf(stderr,
- "Warning: Illegal date format for -z/--timecond and not "
- "a file name.\n"
- " See curl_getdate(3) for valid date syntax.\n");
+ if(!(config->conf & CONF_MUTE))
+ fprintf(stderr,
+ "Warning: Illegal date format for -z/--timecond and not "
+ "a file name.\n"
+ " See curl_getdate(3) for valid date syntax.\n");
}
else {
/* pull the time out from the file */