Fossil SCM

Constness fix to the new fossil_spawn() function to avoid compiler complaints on current macOS.

wyoung 2021-06-22 07:56 fossil-spawn
Commit eefb8e64ed9b0e99e44a8ae30997167b6ca045d0a951ff732a75617e840ad864
1 file changed +2 -2
+2 -2
--- src/util.c
+++ src/util.c
@@ -370,11 +370,11 @@
370370
** A cross-platform "spawn" type function: search for zProgram in PATH,
371371
** passing the given argument list through without interpretation. Due
372372
** to Windows platform limitations — see the definition of WinMain() —
373373
** this is an ideal we can achieve only on POSIX platforms.
374374
*/
375
-int fossil_spawn(const char* zProgram, char* const azArgv[])
375
+int fossil_spawn(const char* zProgram, char * const azArgv[])
376376
{
377377
extern char **environ;
378378
int status = -1;
379379
pid_t pid;
380380
if(posix_spawnp(&pid, zProgram, NULL, NULL, azArgv, environ)==0){
@@ -397,11 +397,11 @@
397397
** but the way it achieves that exercises a different subset of
398398
** Fossil's functionality.
399399
*/
400400
void test_fossil_spawn_cmd(void){
401401
int i, j=0;
402
- char** azArgv = fossil_malloc(sizeof(char*) * (g.argc + 1));
402
+ char **azArgv = fossil_malloc(sizeof(char*) * (g.argc + 1));
403403
azArgv[j++] = g.nameOfExe;
404404
azArgv[j++] = "test-echo";
405405
if( find_option("hex",0,0) ){
406406
azArgv[j++] = "--hex";
407407
}
408408
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button