Skip to content

misleading/wrong error when using long output filename on Windows #20044

@vszakats

Description

@vszakats

I did this

When using a long output filename on Windows or WINE, this happens:

> curl -q https://curl.se/ --output aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Warning: bad output glob
curl: (3) URL using bad/illegal format or missing URL

Even though the URL has no glob. It also only triggers with long
output filenames. It's a warning, but makes curl quit. To use the
long filename anyway and avoid the error, --globoff works as
a workaround.

Possible cause:

On Windows and MS-DOS, output filename sanitization is done
within glob_match_url(). When it fails, the caller assumes
a glob issue, shows the warning bad output glob and quits.

Maybe related: 4520534 (2016-02-05)

Ref: #20040 (comment)

I expected the following

  • long filenames not to trigger a URL glob warning.
  • not to show a glob warning for a URL without globs.
  • say 'error' instead of 'warning' if the issue is fatal.
  • allow using long filenames on Windows.
  • apply the sanitizer also when using --globoff?

curl/libcurl version

master (and possibly earlier stable releases)

operating system

Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions