]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl: remove -J "informational" written on stdout
authorDaniel Stenberg <daniel@haxx.se>
Wed, 20 May 2020 11:21:00 +0000 (13:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 23 May 2020 21:12:53 +0000 (23:12 +0200)
curl would previously show "curl: Saved to filename 'name from header'"
if -J was used and a name was picked from the Content-Disposition
header. That output could interfer with other stdout output, such as -w.

This commit removes that output line.
Bug: https://curl.haxx.se/mail/archive-2020-05/0044.html
Reported-by: Коваленко Анатолий Викторович
Closes #5435

src/tool_operate.c
tests/data/test1340
tests/data/test1341

index 5d3ac7afeaa7a122a3d0ff83642ffd6baf6406f8..6010a952f7adcbc30d491307af472ec5f6eaf6b0 100644 (file)
@@ -425,10 +425,6 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
     metalink_parser_context_delete(outs->metalink_parser);
 #endif /* USE_METALINK */
 
-  if(outs->is_cd_filename && outs->stream && !global->mute &&
-     outs->filename)
-    printf("curl: Saved to filename '%s'\n", outs->filename);
-
   /* if retry-max-time is non-zero, make sure we haven't exceeded the
      time */
   if(per->retry_numretries &&
index 81f1ed68d359a4908c08f405c96abeb1f730efee..644fb2b51662d27c46cd8955fdb0fc2027c04203 100644 (file)
@@ -40,7 +40,7 @@ HTTP GET with -O -J and Content-Disposition, -D file
 CURL_TESTDIR=%PWD/log
 </setenv>
 <command option="no-output,no-include">
-http://%HOSTIP:%HTTPPORT/1340 -J -O -D log/heads1340
+http://%HOSTIP:%HTTPPORT/1340 -J -O -D log/heads1340 -w "curl: Saved to filename %{filename_effective}\n"
 </command>
 </client>
 
@@ -73,7 +73,7 @@ Content-Disposition: filename=name1340; charset=funny; option=strange
 </file2>
 
 <file3 name="log/stdout1340" mode="text">
-curl: Saved to filename '%PWD/log/name1340'
+curl: Saved to filename %PWD/log/name1340
 </file3>
 
 </verify>
index b364edeb147f89985b65a90057795f5683905bbb..ae226744c91ec7782ee37909520bb581c83666c7 100644 (file)
@@ -40,7 +40,7 @@ HTTP GET with -O -J and Content-Disposition, -D stdout
 CURL_TESTDIR=%PWD/log
 </setenv>
 <command option="no-output,no-include">
-http://%HOSTIP:%HTTPPORT/1341 -J -O -D -
+http://%HOSTIP:%HTTPPORT/1341 -J -O -D - -w "curl: Saved to filename %{filename_effective}\n"
 </command>
 </client>
 
@@ -70,7 +70,7 @@ Connection: close
 Content-Type: text/html\r
 Content-Disposition: filename=name1341; charset=funny; option=strange\r
 \r
-curl: Saved to filename '%PWD/log/name1341'
+curl: Saved to filename %PWD/log/name1341
 </file2>
 
 </verify>