Fossil SCM
Update the fossil_system() function so that it converts the system command form UTF8 into MBCS before calling system(). Speculative fix for ticket [8d916f5fc30be3].
Commit
a65c97afd622bb1ac861eac745e02f8f990d37fe
Parent
eea64490987a16b…
1 file changed
+3
-1
+3
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -430,11 +430,13 @@ | ||
| 430 | 430 | #if defined(_WIN32) |
| 431 | 431 | /* On windows, we have to put double-quotes around the entire command. |
| 432 | 432 | ** Who knows why - this is just the way windows works. |
| 433 | 433 | */ |
| 434 | 434 | char *zNewCmd = mprintf("\"%s\"", zOrigCmd); |
| 435 | - rc = system(zNewCmd); | |
| 435 | + char *zMbcs = fossil_utf8_to_mbcs(zNewCmd); | |
| 436 | + rc = system(zMbcs); | |
| 437 | + fossil_mbcs_free(zMbcs); | |
| 436 | 438 | free(zNewCmd); |
| 437 | 439 | #else |
| 438 | 440 | /* On unix, evaluate the command directly. |
| 439 | 441 | */ |
| 440 | 442 | rc = system(zOrigCmd); |
| 441 | 443 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -430,11 +430,13 @@ | |
| 430 | #if defined(_WIN32) |
| 431 | /* On windows, we have to put double-quotes around the entire command. |
| 432 | ** Who knows why - this is just the way windows works. |
| 433 | */ |
| 434 | char *zNewCmd = mprintf("\"%s\"", zOrigCmd); |
| 435 | rc = system(zNewCmd); |
| 436 | free(zNewCmd); |
| 437 | #else |
| 438 | /* On unix, evaluate the command directly. |
| 439 | */ |
| 440 | rc = system(zOrigCmd); |
| 441 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -430,11 +430,13 @@ | |
| 430 | #if defined(_WIN32) |
| 431 | /* On windows, we have to put double-quotes around the entire command. |
| 432 | ** Who knows why - this is just the way windows works. |
| 433 | */ |
| 434 | char *zNewCmd = mprintf("\"%s\"", zOrigCmd); |
| 435 | char *zMbcs = fossil_utf8_to_mbcs(zNewCmd); |
| 436 | rc = system(zMbcs); |
| 437 | fossil_mbcs_free(zMbcs); |
| 438 | free(zNewCmd); |
| 439 | #else |
| 440 | /* On unix, evaluate the command directly. |
| 441 | */ |
| 442 | rc = system(zOrigCmd); |
| 443 |