#863 question mark in the file name

closed-fixed
nobody
5
2014-08-19
2009-09-25
vi6nwnqrco
No

Curl from http://www.paehl.com/ , Windows XP SP2

>curl.exe -V

curl 7.19.6 (i386-pc-win32) libcurl/7.19.6 OpenSSL/1.0.0 zlib/1.2.3 libssh2/1.1
Protocols: tftp ftp telnet dict ldap http file https ftps scp sftp
Features: Largefile NTLM SSL libz

>curl.exe -L -O -k https://addons.mozilla.org/ru/firefox/downloads/latest/220/addon-220-latest.xpi?src=addondetail

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 310k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0Warning: Failed to create the file addon-220-latest.xpi?src=addondetail
0 310k 0 1072 0 0 623 0 0:08:30 0:00:01 0:08:29 1046k
curl: (23) Failed writing body (0 != 1072)

Discussion

1 2 > >> (Page 1 of 2)
  • Dan Fandrich
    Dan Fandrich
    2009-09-25

    • labels: --> client module
    • milestone: --> wrong_behaviour
     
  • Dan Fandrich
    Dan Fandrich
    2009-09-25

    I posted te attached patch (now rebased to the latest source) to the mailing list last year (IIRC) to fix this problem, but without access to a Windows build system, I can't test it. If you can verify that it works, it will make it more likely to be checked in.

     
  • Dan Fandrich
    Dan Fandrich
    2009-09-25

    Don't use illegal file name characters under Windows

     
  • Thanks for reporting this issue and helping us improve curl and libcurl.

    We're awaiting feedback in this issue. Due to this, I have set the state of this issue to pending and it will automatically get closed later on unless we get further info.

    Please consider answering the outstanding questions or providing the missing info so that we can proceed to resolve this issue!

     
    • status: open --> pending
     
  • vi6nwnqrco
    vi6nwnqrco
    2009-10-14

    I dummy and was unable to compile the patched curl...

    Functions msdosify and rename_if_dos_device_name are inside "#ifdef MSDOS".

    After the change "#ifdef MSDOS" to "#if defined (MSDOS) || defined (WIN32)", deleting "&& (S_ISCHR(st_buf.st_mode))" and adding
    #ifdef WIN32
    #define PATH_MAX 512
    static const char *msdosify(const char *);
    static char *rename_if_dos_device_name(char *);
    #endif /* WIN32 */

    I managed to compile curl with one warning:
    main.c(5566) : warning C4133: 'function' : incompatible types - from 'struct stat *' to 'struct _stati64 *'

    >curl.exe -L -O -k http://addons.mozilla.org/ru/firefox/downloads/latest/220/addon-220-latest.xpi?src=addondetail

    I got a file "addon-220-latest.xpi_src=addondetail".

    Compiled binary and patched main.c: http://www.rapidspread.com/file.jsp?id=bmksu5a63v

     
  • vi6nwnqrco
    vi6nwnqrco
    2009-10-14

    • status: pending --> open
     
  • Dan Fandrich
    Dan Fandrich
    2009-10-16

    I've tweaked your patch to come up with the new one which I am attaching. Would you please give that a try?

    Also, under what conditions do you see that corrupted file name? Can you show a complete session showing what commands you ran to get that file name and where the corrupted file name is seen? Thanks.

     
  • Dan Fandrich
    Dan Fandrich
    2009-10-16

    Improved patch

     
    Attachments
1 2 > >> (Page 1 of 2)