Fossil SCM
Fix a bug in Windows builds introduced by [fc0b9325f02b16b3]: When escaping arguments for the CMD.EXE which are not filenames, allow % to pass through unaltered and unquoted. This is necessary so that we can construct a URL that contains a "%d" field to hold the TCP port number.
Commit
c2c02cd7d1f50df46df9e3437cc4a8258cdb4622e358d760bc2921cceeb13d05
Parent
818a6ad79aee3eb…
1 file changed
+1
-1
+1
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -1701,11 +1701,11 @@ | ||
| 1701 | 1701 | } |
| 1702 | 1702 | for(i=0; (c = (unsigned char)zIn[i])!=0; i++){ |
| 1703 | 1703 | blob_append_char(pBlob, (char)c); |
| 1704 | 1704 | if( c=='"' ) blob_append_char(pBlob, '"'); |
| 1705 | 1705 | if( c=='\\' ) blob_append_char(pBlob, '\\'); |
| 1706 | - if( c=='%' ) blob_append(pBlob, "%cd:~,%", 7); | |
| 1706 | + if( c=='%' && isFilename ) blob_append(pBlob, "%cd:~,%", 7); | |
| 1707 | 1707 | } |
| 1708 | 1708 | blob_append_char(pBlob, '"'); |
| 1709 | 1709 | #else |
| 1710 | 1710 | /* Quoting strategy for unix: |
| 1711 | 1711 | ** If the name does not contain ', then surround the whole thing |
| 1712 | 1712 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1701,11 +1701,11 @@ | |
| 1701 | } |
| 1702 | for(i=0; (c = (unsigned char)zIn[i])!=0; i++){ |
| 1703 | blob_append_char(pBlob, (char)c); |
| 1704 | if( c=='"' ) blob_append_char(pBlob, '"'); |
| 1705 | if( c=='\\' ) blob_append_char(pBlob, '\\'); |
| 1706 | if( c=='%' ) blob_append(pBlob, "%cd:~,%", 7); |
| 1707 | } |
| 1708 | blob_append_char(pBlob, '"'); |
| 1709 | #else |
| 1710 | /* Quoting strategy for unix: |
| 1711 | ** If the name does not contain ', then surround the whole thing |
| 1712 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1701,11 +1701,11 @@ | |
| 1701 | } |
| 1702 | for(i=0; (c = (unsigned char)zIn[i])!=0; i++){ |
| 1703 | blob_append_char(pBlob, (char)c); |
| 1704 | if( c=='"' ) blob_append_char(pBlob, '"'); |
| 1705 | if( c=='\\' ) blob_append_char(pBlob, '\\'); |
| 1706 | if( c=='%' && isFilename ) blob_append(pBlob, "%cd:~,%", 7); |
| 1707 | } |
| 1708 | blob_append_char(pBlob, '"'); |
| 1709 | #else |
| 1710 | /* Quoting strategy for unix: |
| 1711 | ** If the name does not contain ', then surround the whole thing |
| 1712 |