Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curl 8.6.0 doesn't allow unsetting of the -w field. #13144

Closed
tpyle opened this issue Mar 18, 2024 · 3 comments
Closed

Curl 8.6.0 doesn't allow unsetting of the -w field. #13144

tpyle opened this issue Mar 18, 2024 · 3 comments

Comments

@tpyle
Copy link

tpyle commented Mar 18, 2024

I did this

curl -w '' http://example.com

curl: option -w: blank argument where content is expected
curl: try 'curl --help' for more information

I expected the following

The website to return with no additional output

curl/libcurl version

curl 8.6.0

operating system

Arch Linux 20240101.0.204074 (the latest arch linux)

@tpyle
Copy link
Author

tpyle commented Mar 18, 2024

I believe this was introduced in #12620. This may be expected behavior.

@lydell
Copy link

lydell commented Mar 18, 2024

I came here to write about this too :)

I just merged a workaround for this: elm-tooling/elm-tooling-cli#128

In my case, this is the story (a bit of XKCD 1172 vibes here):

  • Some people put -w "\n" in their .curlrc. Is it a good idea? I don’t know 🤷. But this StackOverflow answer has 600+ upvotes: https://stackoverflow.com/a/14614203/2010616
  • That “elm-tooling” thing I linked to uses curl to download stuff. The checksums fail with that extra newline appended.
  • I added -w "" as a workaround for people with -w "\n" in their .curlrc. Are there more things that people can set in .curlrc that will mess with my download script? Probably. Has anyone complained? None so far.
  • I don’t want to use -q because if people configure proxy stuff in .curlrc I want that to be used.

Is it a bug? I’ll leave that to the maintainers to judge. Either way, here’s my workaround:

-w "%{stderr}"

%{stderr} doesn’t print anything of itself, it just makes the rest of the-w string get written to stderr. “The rest of the string” is nothing in this case. So in practice this has the same effect as the empty string, without being empty :)

bagder added a commit that referenced this issue Mar 18, 2024
Added test 468 to verify.

Regression from 07bcae8 (shipped in 8.6.0)
Reported-by: Thomas Pyle
Fixes #13144
@bagder bagder self-assigned this Mar 18, 2024
@tpyle
Copy link
Author

tpyle commented Mar 18, 2024

@lydell thanks for the workaround!

@bagder bagder closed this as completed in 6bd4ca0 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants