Skip to content

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

Description

@tpyle

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)

Activity

  1. tpyle commented on Mar 18, 2024

    @tpyle
    Author

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

  2. lydell commented on Mar 18, 2024

    @lydell

    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 :)

  3. added a commit that references this issue on Mar 18, 2024
    35cd057
  4. self-assigned this
    on Mar 18, 2024
  5. tpyle commented on Mar 18, 2024

    @tpyle
    Author

    @lydell thanks for the workaround!

  6. added a commit that references this issue on Mar 19, 2024
    6bd4ca0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions