Changes to ticket 40df1ced7e
By anonymous on 2009-06-23 20:26:51. See also: artifact content, and ticket history
- Appended to comment:
anonymous claiming to be Twylite added on 2009-06-23 20:26:51:
Possible fix: use an #ifdef to change quoting on WIN32.The following patch appears to fix the problem (tested on WinXP SP3 under cmd shell and msys). It should leave the behaviour on *nix systems untouched.
--- src/http_transport.c +++ src/http_transport.c @@ -140,14 +140,21 @@ /* ** This routine is called when the outbound message is complete and ** it is time to being recieving a reply. */ void transport_flip(void){ +#ifdef __MINGW32__ + /* If a command begins with a quote, cmd.exe will strip the leading char + * and the last quote char on the line. See 'cmd /?' */ + char* cmdformat = "\"\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1\""; +#else + char* cmdformat = "\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1"; +#endif if( g.urlIsFile ){ char *zCmd; fclose(transport.pFile); - zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1", + zCmd = mprintf(cmdformat, g.argv[bad-link: 0]0, g.urlName, transport.zOutFile, transport.zInFile ); system(zCmd); free(zCmd); transport.pFile = fopen(transport.zInFile, "rb");