]> git.ipfire.org Git - thirdparty/curl.git/commit
tool_operate: fix the suppression logic of some error messages
authorJay Satiro <raysatiro@yahoo.com>
Sat, 2 Jan 2021 08:40:24 +0000 (03:40 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Mon, 4 Jan 2021 23:02:50 +0000 (18:02 -0500)
commitdf1240ccac9b6efc86213161ee242f3118392fa1
tree5e208297d0d287ffc9ceb524448975bf5c0d4113
parent7de2e96535e97f2446fea077402caab2ee291425
tool_operate: fix the suppression logic of some error messages

- Fix the failed truncation and failed writing body error messages to
  not be shown unless error messages are shown. (ie the user has
  specified -sS, or has not specified -s).

- Also prefix same error messages with "curl: ", for example:
  curl: (23) Failed to truncate, exiting

Prior to this change the failed truncation error messages would be shown
if not -s, but did not account for -sS which should show.

Prior to this change the failed writing body error messages would be
shown always.

Ref: https://curl.se/docs/manpage.html#-S

Bug: https://curl.se/mail/archive-2020-12/0017.html
Reported-by: Hongyi Zhao
Closes https://github.com/curl/curl/pull/6402
src/tool_operate.c