aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-06-26 01:43:53 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-06-26 01:43:53 +0000
commit8c377ad965e8317f622007cc093203d3086b614f (patch)
tree42c6827175e4c3db71bcad63c6da04cda8ab217b /src
parenta81a16beacaa4b948ce487ac82589cbf0553b25e (diff)
Honour --stderr with the -v option.
Fixed a file handle leak in the command line client if more than one --stderr option was given.
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 077dc8c28..756c09b71 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1950,7 +1950,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
break;
case 'u': /* --crlf */
- /* LF -> CRLF conversinon? */
+ /* LF -> CRLF conversion? */
config->crlf = TRUE;
break;
@@ -1960,6 +1960,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
if(!newfile)
warnf(config, "Failed to open %s!\n", nextarg);
else {
+ if(config->errors_fopened)
+ fclose(config->errors);
config->errors = newfile;
config->errors_fopened = TRUE;
}
@@ -3449,7 +3451,7 @@ int my_trace(CURL *handle, curl_infotype type,
config->trace_stream = stdout;
else if(curlx_strequal("%", config->trace_dump))
/* Ok, this is somewhat hackish but we do it undocumented for now */
- config->trace_stream = stderr;
+ config->trace_stream = config->errors; /* aka stderr */
else {
config->trace_stream = fopen(config->trace_dump, "w");
config->trace_fopened = TRUE;