Fossil SCM
Constness fix to the new fossil_spawn() function to avoid compiler complaints on current macOS.
Commit
eefb8e64ed9b0e99e44a8ae30997167b6ca045d0a951ff732a75617e840ad864
Parent
765acbc080804aa…
1 file changed
+2
-2
+2
-2
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -370,11 +370,11 @@ | ||
| 370 | 370 | ** A cross-platform "spawn" type function: search for zProgram in PATH, |
| 371 | 371 | ** passing the given argument list through without interpretation. Due |
| 372 | 372 | ** to Windows platform limitations — see the definition of WinMain() — |
| 373 | 373 | ** this is an ideal we can achieve only on POSIX platforms. |
| 374 | 374 | */ |
| 375 | -int fossil_spawn(const char* zProgram, char* const azArgv[]) | |
| 375 | +int fossil_spawn(const char* zProgram, char * const azArgv[]) | |
| 376 | 376 | { |
| 377 | 377 | extern char **environ; |
| 378 | 378 | int status = -1; |
| 379 | 379 | pid_t pid; |
| 380 | 380 | if(posix_spawnp(&pid, zProgram, NULL, NULL, azArgv, environ)==0){ |
| @@ -397,11 +397,11 @@ | ||
| 397 | 397 | ** but the way it achieves that exercises a different subset of |
| 398 | 398 | ** Fossil's functionality. |
| 399 | 399 | */ |
| 400 | 400 | void test_fossil_spawn_cmd(void){ |
| 401 | 401 | int i, j=0; |
| 402 | - char** azArgv = fossil_malloc(sizeof(char*) * (g.argc + 1)); | |
| 402 | + char **azArgv = fossil_malloc(sizeof(char*) * (g.argc + 1)); | |
| 403 | 403 | azArgv[j++] = g.nameOfExe; |
| 404 | 404 | azArgv[j++] = "test-echo"; |
| 405 | 405 | if( find_option("hex",0,0) ){ |
| 406 | 406 | azArgv[j++] = "--hex"; |
| 407 | 407 | } |
| 408 | 408 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -370,11 +370,11 @@ | |
| 370 | ** A cross-platform "spawn" type function: search for zProgram in PATH, |
| 371 | ** passing the given argument list through without interpretation. Due |
| 372 | ** to Windows platform limitations — see the definition of WinMain() — |
| 373 | ** this is an ideal we can achieve only on POSIX platforms. |
| 374 | */ |
| 375 | int fossil_spawn(const char* zProgram, char* const azArgv[]) |
| 376 | { |
| 377 | extern char **environ; |
| 378 | int status = -1; |
| 379 | pid_t pid; |
| 380 | if(posix_spawnp(&pid, zProgram, NULL, NULL, azArgv, environ)==0){ |
| @@ -397,11 +397,11 @@ | |
| 397 | ** but the way it achieves that exercises a different subset of |
| 398 | ** Fossil's functionality. |
| 399 | */ |
| 400 | void test_fossil_spawn_cmd(void){ |
| 401 | int i, j=0; |
| 402 | char** azArgv = fossil_malloc(sizeof(char*) * (g.argc + 1)); |
| 403 | azArgv[j++] = g.nameOfExe; |
| 404 | azArgv[j++] = "test-echo"; |
| 405 | if( find_option("hex",0,0) ){ |
| 406 | azArgv[j++] = "--hex"; |
| 407 | } |
| 408 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -370,11 +370,11 @@ | |
| 370 | ** A cross-platform "spawn" type function: search for zProgram in PATH, |
| 371 | ** passing the given argument list through without interpretation. Due |
| 372 | ** to Windows platform limitations — see the definition of WinMain() — |
| 373 | ** this is an ideal we can achieve only on POSIX platforms. |
| 374 | */ |
| 375 | int fossil_spawn(const char* zProgram, char * const azArgv[]) |
| 376 | { |
| 377 | extern char **environ; |
| 378 | int status = -1; |
| 379 | pid_t pid; |
| 380 | if(posix_spawnp(&pid, zProgram, NULL, NULL, azArgv, environ)==0){ |
| @@ -397,11 +397,11 @@ | |
| 397 | ** but the way it achieves that exercises a different subset of |
| 398 | ** Fossil's functionality. |
| 399 | */ |
| 400 | void test_fossil_spawn_cmd(void){ |
| 401 | int i, j=0; |
| 402 | char **azArgv = fossil_malloc(sizeof(char*) * (g.argc + 1)); |
| 403 | azArgv[j++] = g.nameOfExe; |
| 404 | azArgv[j++] = "test-echo"; |
| 405 | if( find_option("hex",0,0) ){ |
| 406 | azArgv[j++] = "--hex"; |
| 407 | } |
| 408 |