Overview
SHA1 Hash: | 0eb08b860c5b851c074113fd459d1cd0671f4805 |
---|---|
Date: | 2009-09-16 21:29:18 |
User: | drh |
Comment: | Change more system() calls into portable_system() in an effort to fix path quoting problems on windows. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/allrepo.c from [8f62ffa7a2] to [22228def76].
@@ -127,11 +127,11 @@ } zQFilename = quoteFilename(zFilename); zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename); printf("%s\n", zSyscmd); fflush(stdout); - system(zSyscmd); + portable_system(zSyscmd); free(zSyscmd); free(zQFilename); } /* If any repositories hows names appear in the ~/.fossil file could not
Modified src/checkin.c from [80178835f0] to [6bbed2063d].
@@ -290,11 +290,11 @@ blob_add_cr(&text); #endif blob_write_to_file(&text, zFile); zCmd = mprintf("%s \"%s\"", zEditor, zFile); printf("%s\n", zCmd); - if( system(zCmd) ){ + if( portable_system(zCmd) ){ fossil_panic("editor aborted"); } blob_reset(&text); blob_read_from_file(&text, zFile); blob_remove_cr(&text);
Modified src/clearsign.c from [3e61358e2b] to [4431c80a36].
@@ -45,11 +45,11 @@ zRand = db_text(0, "SELECT hex(randomblob(10))"); zOut = mprintf("out-%s", zRand); zIn = mprintf("in-%z", zRand); blob_write_to_file(pIn, zOut); zCmd = mprintf("%s %s %s", zBase, zIn, zOut); - rc = system(zCmd); + rc = portable_system(zCmd); free(zCmd); if( rc==0 ){ if( pOut==pIn ){ blob_reset(pIn); }
Modified src/diffcmd.c from [d11c5b0707] to [4832395b8a].
@@ -100,11 +100,11 @@ zPathname ); shell_escape(&cmd, zFullName); printf("%s\n", blob_str(&cmd)); fflush(stdout); - system(blob_str(&cmd)); + portable_system(blob_str(&cmd)); } free(zFullName); } db_finalize(&q); } @@ -221,19 +221,21 @@ } /* ** This function implements a cross-platform "system()" interface. */ -void portable_system(char *zOrigCmd){ +int portable_system(char *zOrigCmd){ + int rc; #ifdef __MINGW32__ /* On windows, we have to put double-quotes around the entire command. ** Who knows why - this is just the way windows works. */ char *zNewCmd = mprintf("\"%s\"", zOrigCmd); - system(zNewCmd); + rc = system(zNewCmd); free(zNewCmd); #else /* On unix, evaluate the command directly. */ - system(zOrigCmd); + rc = system(zOrigCmd); #endif + return rc; }
Modified src/http_transport.c from [bc6bc305c4] to [a410394220].
@@ -163,11 +163,10 @@ fclose(transport.pFile); zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1", g.argv[0], g.urlName, transport.zOutFile, transport.zInFile ); portable_system(zCmd); - system(zCmd); free(zCmd); transport.pFile = fopen(transport.zInFile, "rb"); } }