Fossil SCM

merge from trunk

wolfgang 2010-11-07 10:13 UTC StvPrivateHook2 merge
Commit 8050311dd57f595f61e8abc6f9e13db01eb0d71a
+1 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -139,11 +139,11 @@
139139
}
140140
zQFilename = quoteFilename(zFilename);
141141
zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename);
142142
printf("%s\n", zSyscmd);
143143
fflush(stdout);
144
- portable_system(zSyscmd);
144
+ fossil_system(zSyscmd);
145145
free(zSyscmd);
146146
free(zQFilename);
147147
}
148148
149149
/* If any repositories whose names appear in the ~/.fossil file could not
150150
--- src/allrepo.c
+++ src/allrepo.c
@@ -139,11 +139,11 @@
139 }
140 zQFilename = quoteFilename(zFilename);
141 zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename);
142 printf("%s\n", zSyscmd);
143 fflush(stdout);
144 portable_system(zSyscmd);
145 free(zSyscmd);
146 free(zQFilename);
147 }
148
149 /* If any repositories whose names appear in the ~/.fossil file could not
150
--- src/allrepo.c
+++ src/allrepo.c
@@ -139,11 +139,11 @@
139 }
140 zQFilename = quoteFilename(zFilename);
141 zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename);
142 printf("%s\n", zSyscmd);
143 fflush(stdout);
144 fossil_system(zSyscmd);
145 free(zSyscmd);
146 free(zQFilename);
147 }
148
149 /* If any repositories whose names appear in the ~/.fossil file could not
150
+1 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -139,11 +139,11 @@
139139
}
140140
zQFilename = quoteFilename(zFilename);
141141
zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename);
142142
printf("%s\n", zSyscmd);
143143
fflush(stdout);
144
- portable_system(zSyscmd);
144
+ fossil_system(zSyscmd);
145145
free(zSyscmd);
146146
free(zQFilename);
147147
}
148148
149149
/* If any repositories whose names appear in the ~/.fossil file could not
150150
--- src/allrepo.c
+++ src/allrepo.c
@@ -139,11 +139,11 @@
139 }
140 zQFilename = quoteFilename(zFilename);
141 zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename);
142 printf("%s\n", zSyscmd);
143 fflush(stdout);
144 portable_system(zSyscmd);
145 free(zSyscmd);
146 free(zQFilename);
147 }
148
149 /* If any repositories whose names appear in the ~/.fossil file could not
150
--- src/allrepo.c
+++ src/allrepo.c
@@ -139,11 +139,11 @@
139 }
140 zQFilename = quoteFilename(zFilename);
141 zSyscmd = mprintf("%s %s %s", zFossil, zCmd, zQFilename);
142 printf("%s\n", zSyscmd);
143 fflush(stdout);
144 fossil_system(zSyscmd);
145 free(zSyscmd);
146 free(zQFilename);
147 }
148
149 /* If any repositories whose names appear in the ~/.fossil file could not
150
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -422,11 +422,11 @@
422422
blob_add_cr(&text);
423423
#endif
424424
blob_write_to_file(&text, zFile);
425425
zCmd = mprintf("%s \"%s\"", zEditor, zFile);
426426
printf("%s\n", zCmd);
427
- if( portable_system(zCmd) ){
427
+ if( fossil_system(zCmd) ){
428428
fossil_panic("editor aborted");
429429
}
430430
blob_reset(&text);
431431
blob_read_from_file(&text, zFile);
432432
blob_remove_cr(&text);
@@ -703,11 +703,11 @@
703703
**
704704
705705
706706
** Create a new version containing all of the changes in the current
707707
** checkout. You will be prompted to enter a check-in comment unless
708
-** the comment has been specified on the command-line using "-m" or a
708
+** the comment has been specified on the command-line using "-m" or a
709709
** file containing the comment using -M. The editor defined in the
710710
** "editor" fossil option (see %fossil <a>help</a> set) will be used, or from
711711
** the "VISUAL" or "EDITOR" environment variables (in that order) if
712712
** no editor is set.
713713
**
714714
--- src/checkin.c
+++ src/checkin.c
@@ -422,11 +422,11 @@
422 blob_add_cr(&text);
423 #endif
424 blob_write_to_file(&text, zFile);
425 zCmd = mprintf("%s \"%s\"", zEditor, zFile);
426 printf("%s\n", zCmd);
427 if( portable_system(zCmd) ){
428 fossil_panic("editor aborted");
429 }
430 blob_reset(&text);
431 blob_read_from_file(&text, zFile);
432 blob_remove_cr(&text);
@@ -703,11 +703,11 @@
703 **
704
705
706 ** Create a new version containing all of the changes in the current
707 ** checkout. You will be prompted to enter a check-in comment unless
708 ** the comment has been specified on the command-line using "-m" or a
709 ** file containing the comment using -M. The editor defined in the
710 ** "editor" fossil option (see %fossil <a>help</a> set) will be used, or from
711 ** the "VISUAL" or "EDITOR" environment variables (in that order) if
712 ** no editor is set.
713 **
714
--- src/checkin.c
+++ src/checkin.c
@@ -422,11 +422,11 @@
422 blob_add_cr(&text);
423 #endif
424 blob_write_to_file(&text, zFile);
425 zCmd = mprintf("%s \"%s\"", zEditor, zFile);
426 printf("%s\n", zCmd);
427 if( fossil_system(zCmd) ){
428 fossil_panic("editor aborted");
429 }
430 blob_reset(&text);
431 blob_read_from_file(&text, zFile);
432 blob_remove_cr(&text);
@@ -703,11 +703,11 @@
703 **
704
705
706 ** Create a new version containing all of the changes in the current
707 ** checkout. You will be prompted to enter a check-in comment unless
708 ** the comment has been specified on the command-line using "-m" or a
709 ** file containing the comment using -M. The editor defined in the
710 ** "editor" fossil option (see %fossil <a>help</a> set) will be used, or from
711 ** the "VISUAL" or "EDITOR" environment variables (in that order) if
712 ** no editor is set.
713 **
714
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -422,11 +422,11 @@
422422
blob_add_cr(&text);
423423
#endif
424424
blob_write_to_file(&text, zFile);
425425
zCmd = mprintf("%s \"%s\"", zEditor, zFile);
426426
printf("%s\n", zCmd);
427
- if( portable_system(zCmd) ){
427
+ if( fossil_system(zCmd) ){
428428
fossil_panic("editor aborted");
429429
}
430430
blob_reset(&text);
431431
blob_read_from_file(&text, zFile);
432432
blob_remove_cr(&text);
@@ -703,11 +703,11 @@
703703
**
704704
705705
706706
** Create a new version containing all of the changes in the current
707707
** checkout. You will be prompted to enter a check-in comment unless
708
-** the comment has been specified on the command-line using "-m" or a
708
+** the comment has been specified on the command-line using "-m" or a
709709
** file containing the comment using -M. The editor defined in the
710710
** "editor" fossil option (see %fossil <a>help</a> set) will be used, or from
711711
** the "VISUAL" or "EDITOR" environment variables (in that order) if
712712
** no editor is set.
713713
**
714714
--- src/checkin.c
+++ src/checkin.c
@@ -422,11 +422,11 @@
422 blob_add_cr(&text);
423 #endif
424 blob_write_to_file(&text, zFile);
425 zCmd = mprintf("%s \"%s\"", zEditor, zFile);
426 printf("%s\n", zCmd);
427 if( portable_system(zCmd) ){
428 fossil_panic("editor aborted");
429 }
430 blob_reset(&text);
431 blob_read_from_file(&text, zFile);
432 blob_remove_cr(&text);
@@ -703,11 +703,11 @@
703 **
704
705
706 ** Create a new version containing all of the changes in the current
707 ** checkout. You will be prompted to enter a check-in comment unless
708 ** the comment has been specified on the command-line using "-m" or a
709 ** file containing the comment using -M. The editor defined in the
710 ** "editor" fossil option (see %fossil <a>help</a> set) will be used, or from
711 ** the "VISUAL" or "EDITOR" environment variables (in that order) if
712 ** no editor is set.
713 **
714
--- src/checkin.c
+++ src/checkin.c
@@ -422,11 +422,11 @@
422 blob_add_cr(&text);
423 #endif
424 blob_write_to_file(&text, zFile);
425 zCmd = mprintf("%s \"%s\"", zEditor, zFile);
426 printf("%s\n", zCmd);
427 if( fossil_system(zCmd) ){
428 fossil_panic("editor aborted");
429 }
430 blob_reset(&text);
431 blob_read_from_file(&text, zFile);
432 blob_remove_cr(&text);
@@ -703,11 +703,11 @@
703 **
704
705
706 ** Create a new version containing all of the changes in the current
707 ** checkout. You will be prompted to enter a check-in comment unless
708 ** the comment has been specified on the command-line using "-m" or a
709 ** file containing the comment using -M. The editor defined in the
710 ** "editor" fossil option (see %fossil <a>help</a> set) will be used, or from
711 ** the "VISUAL" or "EDITOR" environment variables (in that order) if
712 ** no editor is set.
713 **
714
+1 -1
--- src/clearsign.c
+++ src/clearsign.c
@@ -39,11 +39,11 @@
3939
zRand = db_text(0, "SELECT hex(randomblob(10))");
4040
zOut = mprintf("out-%s", zRand);
4141
zIn = mprintf("in-%z", zRand);
4242
blob_write_to_file(pIn, zOut);
4343
zCmd = mprintf("%s %s %s", zBase, zIn, zOut);
44
- rc = portable_system(zCmd);
44
+ rc = fossil_system(zCmd);
4545
free(zCmd);
4646
if( rc==0 ){
4747
if( pOut==pIn ){
4848
blob_reset(pIn);
4949
}
5050
--- src/clearsign.c
+++ src/clearsign.c
@@ -39,11 +39,11 @@
39 zRand = db_text(0, "SELECT hex(randomblob(10))");
40 zOut = mprintf("out-%s", zRand);
41 zIn = mprintf("in-%z", zRand);
42 blob_write_to_file(pIn, zOut);
43 zCmd = mprintf("%s %s %s", zBase, zIn, zOut);
44 rc = portable_system(zCmd);
45 free(zCmd);
46 if( rc==0 ){
47 if( pOut==pIn ){
48 blob_reset(pIn);
49 }
50
--- src/clearsign.c
+++ src/clearsign.c
@@ -39,11 +39,11 @@
39 zRand = db_text(0, "SELECT hex(randomblob(10))");
40 zOut = mprintf("out-%s", zRand);
41 zIn = mprintf("in-%z", zRand);
42 blob_write_to_file(pIn, zOut);
43 zCmd = mprintf("%s %s %s", zBase, zIn, zOut);
44 rc = fossil_system(zCmd);
45 free(zCmd);
46 if( rc==0 ){
47 if( pOut==pIn ){
48 blob_reset(pIn);
49 }
50
+2 -23
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -25,31 +25,10 @@
2525
** Diff option flags
2626
*/
2727
#define DIFF_NEWFILE 0x01 /* Treat non-existing fails as empty files */
2828
#define DIFF_NOEOLWS 0x02 /* Ignore whitespace at the end of lines */
2929
30
-/*
31
-** This function implements a cross-platform "system()" interface.
32
-*/
33
-int portable_system(const char *zOrigCmd){
34
- int rc;
35
-#if defined(_WIN32)
36
- /* On windows, we have to put double-quotes around the entire command.
37
- ** Who knows why - this is just the way windows works.
38
- */
39
- char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
40
- fflush(0);
41
- rc = system(zNewCmd);
42
- free(zNewCmd);
43
-#else
44
- /* On unix, evaluate the command directly.
45
- */
46
- rc = system(zOrigCmd);
47
-#endif
48
- return rc;
49
-}
50
-
5130
/*
5231
** Show the difference between two files, one in memory and one on disk.
5332
**
5433
** The difference is the set of edits needed to transform pFile1 into
5534
** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
@@ -107,11 +86,11 @@
10786
shell_escape(&cmd, blob_str(&nameFile1));
10887
blob_append(&cmd, " ", 1);
10988
shell_escape(&cmd, zFile2);
11089
11190
/* Run the external diff command */
112
- portable_system(blob_str(&cmd));
91
+ fossil_system(blob_str(&cmd));
11392
11493
/* Delete the temporary file and clean up memory used */
11594
unlink(blob_str(&nameFile1));
11695
blob_reset(&nameFile1);
11796
blob_reset(&cmd);
@@ -161,11 +140,11 @@
161140
shell_escape(&cmd, zTemp1);
162141
blob_append(&cmd, " ", 1);
163142
shell_escape(&cmd, zTemp2);
164143
165144
/* Run the external diff command */
166
- portable_system(blob_str(&cmd));
145
+ fossil_system(blob_str(&cmd));
167146
168147
/* Delete the temporary file and clean up memory used */
169148
unlink(zTemp1);
170149
unlink(zTemp2);
171150
blob_reset(&cmd);
172151
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -25,31 +25,10 @@
25 ** Diff option flags
26 */
27 #define DIFF_NEWFILE 0x01 /* Treat non-existing fails as empty files */
28 #define DIFF_NOEOLWS 0x02 /* Ignore whitespace at the end of lines */
29
30 /*
31 ** This function implements a cross-platform "system()" interface.
32 */
33 int portable_system(const char *zOrigCmd){
34 int rc;
35 #if defined(_WIN32)
36 /* On windows, we have to put double-quotes around the entire command.
37 ** Who knows why - this is just the way windows works.
38 */
39 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
40 fflush(0);
41 rc = system(zNewCmd);
42 free(zNewCmd);
43 #else
44 /* On unix, evaluate the command directly.
45 */
46 rc = system(zOrigCmd);
47 #endif
48 return rc;
49 }
50
51 /*
52 ** Show the difference between two files, one in memory and one on disk.
53 **
54 ** The difference is the set of edits needed to transform pFile1 into
55 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
@@ -107,11 +86,11 @@
107 shell_escape(&cmd, blob_str(&nameFile1));
108 blob_append(&cmd, " ", 1);
109 shell_escape(&cmd, zFile2);
110
111 /* Run the external diff command */
112 portable_system(blob_str(&cmd));
113
114 /* Delete the temporary file and clean up memory used */
115 unlink(blob_str(&nameFile1));
116 blob_reset(&nameFile1);
117 blob_reset(&cmd);
@@ -161,11 +140,11 @@
161 shell_escape(&cmd, zTemp1);
162 blob_append(&cmd, " ", 1);
163 shell_escape(&cmd, zTemp2);
164
165 /* Run the external diff command */
166 portable_system(blob_str(&cmd));
167
168 /* Delete the temporary file and clean up memory used */
169 unlink(zTemp1);
170 unlink(zTemp2);
171 blob_reset(&cmd);
172
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -25,31 +25,10 @@
25 ** Diff option flags
26 */
27 #define DIFF_NEWFILE 0x01 /* Treat non-existing fails as empty files */
28 #define DIFF_NOEOLWS 0x02 /* Ignore whitespace at the end of lines */
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30 /*
31 ** Show the difference between two files, one in memory and one on disk.
32 **
33 ** The difference is the set of edits needed to transform pFile1 into
34 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
@@ -107,11 +86,11 @@
86 shell_escape(&cmd, blob_str(&nameFile1));
87 blob_append(&cmd, " ", 1);
88 shell_escape(&cmd, zFile2);
89
90 /* Run the external diff command */
91 fossil_system(blob_str(&cmd));
92
93 /* Delete the temporary file and clean up memory used */
94 unlink(blob_str(&nameFile1));
95 blob_reset(&nameFile1);
96 blob_reset(&cmd);
@@ -161,11 +140,11 @@
140 shell_escape(&cmd, zTemp1);
141 blob_append(&cmd, " ", 1);
142 shell_escape(&cmd, zTemp2);
143
144 /* Run the external diff command */
145 fossil_system(blob_str(&cmd));
146
147 /* Delete the temporary file and clean up memory used */
148 unlink(zTemp1);
149 unlink(zTemp2);
150 blob_reset(&cmd);
151
+2 -23
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -25,31 +25,10 @@
2525
** Diff option flags
2626
*/
2727
#define DIFF_NEWFILE 0x01 /* Treat non-existing fails as empty files */
2828
#define DIFF_NOEOLWS 0x02 /* Ignore whitespace at the end of lines */
2929
30
-/*
31
-** This function implements a cross-platform "system()" interface.
32
-*/
33
-int portable_system(const char *zOrigCmd){
34
- int rc;
35
-#if defined(_WIN32)
36
- /* On windows, we have to put double-quotes around the entire command.
37
- ** Who knows why - this is just the way windows works.
38
- */
39
- char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
40
- fflush(0);
41
- rc = system(zNewCmd);
42
- free(zNewCmd);
43
-#else
44
- /* On unix, evaluate the command directly.
45
- */
46
- rc = system(zOrigCmd);
47
-#endif
48
- return rc;
49
-}
50
-
5130
/*
5231
** Show the difference between two files, one in memory and one on disk.
5332
**
5433
** The difference is the set of edits needed to transform pFile1 into
5534
** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
@@ -107,11 +86,11 @@
10786
shell_escape(&cmd, blob_str(&nameFile1));
10887
blob_append(&cmd, " ", 1);
10988
shell_escape(&cmd, zFile2);
11089
11190
/* Run the external diff command */
112
- portable_system(blob_str(&cmd));
91
+ fossil_system(blob_str(&cmd));
11392
11493
/* Delete the temporary file and clean up memory used */
11594
unlink(blob_str(&nameFile1));
11695
blob_reset(&nameFile1);
11796
blob_reset(&cmd);
@@ -161,11 +140,11 @@
161140
shell_escape(&cmd, zTemp1);
162141
blob_append(&cmd, " ", 1);
163142
shell_escape(&cmd, zTemp2);
164143
165144
/* Run the external diff command */
166
- portable_system(blob_str(&cmd));
145
+ fossil_system(blob_str(&cmd));
167146
168147
/* Delete the temporary file and clean up memory used */
169148
unlink(zTemp1);
170149
unlink(zTemp2);
171150
blob_reset(&cmd);
172151
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -25,31 +25,10 @@
25 ** Diff option flags
26 */
27 #define DIFF_NEWFILE 0x01 /* Treat non-existing fails as empty files */
28 #define DIFF_NOEOLWS 0x02 /* Ignore whitespace at the end of lines */
29
30 /*
31 ** This function implements a cross-platform "system()" interface.
32 */
33 int portable_system(const char *zOrigCmd){
34 int rc;
35 #if defined(_WIN32)
36 /* On windows, we have to put double-quotes around the entire command.
37 ** Who knows why - this is just the way windows works.
38 */
39 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
40 fflush(0);
41 rc = system(zNewCmd);
42 free(zNewCmd);
43 #else
44 /* On unix, evaluate the command directly.
45 */
46 rc = system(zOrigCmd);
47 #endif
48 return rc;
49 }
50
51 /*
52 ** Show the difference between two files, one in memory and one on disk.
53 **
54 ** The difference is the set of edits needed to transform pFile1 into
55 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
@@ -107,11 +86,11 @@
107 shell_escape(&cmd, blob_str(&nameFile1));
108 blob_append(&cmd, " ", 1);
109 shell_escape(&cmd, zFile2);
110
111 /* Run the external diff command */
112 portable_system(blob_str(&cmd));
113
114 /* Delete the temporary file and clean up memory used */
115 unlink(blob_str(&nameFile1));
116 blob_reset(&nameFile1);
117 blob_reset(&cmd);
@@ -161,11 +140,11 @@
161 shell_escape(&cmd, zTemp1);
162 blob_append(&cmd, " ", 1);
163 shell_escape(&cmd, zTemp2);
164
165 /* Run the external diff command */
166 portable_system(blob_str(&cmd));
167
168 /* Delete the temporary file and clean up memory used */
169 unlink(zTemp1);
170 unlink(zTemp2);
171 blob_reset(&cmd);
172
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -25,31 +25,10 @@
25 ** Diff option flags
26 */
27 #define DIFF_NEWFILE 0x01 /* Treat non-existing fails as empty files */
28 #define DIFF_NOEOLWS 0x02 /* Ignore whitespace at the end of lines */
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30 /*
31 ** Show the difference between two files, one in memory and one on disk.
32 **
33 ** The difference is the set of edits needed to transform pFile1 into
34 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
@@ -107,11 +86,11 @@
86 shell_escape(&cmd, blob_str(&nameFile1));
87 blob_append(&cmd, " ", 1);
88 shell_escape(&cmd, zFile2);
89
90 /* Run the external diff command */
91 fossil_system(blob_str(&cmd));
92
93 /* Delete the temporary file and clean up memory used */
94 unlink(blob_str(&nameFile1));
95 blob_reset(&nameFile1);
96 blob_reset(&cmd);
@@ -161,11 +140,11 @@
140 shell_escape(&cmd, zTemp1);
141 blob_append(&cmd, " ", 1);
142 shell_escape(&cmd, zTemp2);
143
144 /* Run the external diff command */
145 fossil_system(blob_str(&cmd));
146
147 /* Delete the temporary file and clean up memory used */
148 unlink(zTemp1);
149 unlink(zTemp2);
150 blob_reset(&cmd);
151
--- src/http_transport.c
+++ src/http_transport.c
@@ -296,11 +296,11 @@
296296
char *zCmd;
297297
fclose(transport.pFile);
298298
zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1",
299299
g.argv[0], g.urlName, transport.zOutFile, transport.zInFile
300300
);
301
- portable_system(zCmd);
301
+ fossil_system(zCmd);
302302
free(zCmd);
303303
transport.pFile = fopen(transport.zInFile, "rb");
304304
}
305305
}
306306
307307
--- src/http_transport.c
+++ src/http_transport.c
@@ -296,11 +296,11 @@
296 char *zCmd;
297 fclose(transport.pFile);
298 zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1",
299 g.argv[0], g.urlName, transport.zOutFile, transport.zInFile
300 );
301 portable_system(zCmd);
302 free(zCmd);
303 transport.pFile = fopen(transport.zInFile, "rb");
304 }
305 }
306
307
--- src/http_transport.c
+++ src/http_transport.c
@@ -296,11 +296,11 @@
296 char *zCmd;
297 fclose(transport.pFile);
298 zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1",
299 g.argv[0], g.urlName, transport.zOutFile, transport.zInFile
300 );
301 fossil_system(zCmd);
302 free(zCmd);
303 transport.pFile = fopen(transport.zInFile, "rb");
304 }
305 }
306
307
+21
--- src/main.c
+++ src/main.c
@@ -383,10 +383,31 @@
383383
void *fossil_realloc(void *p, size_t n){
384384
p = realloc(p, n);
385385
if( p==0 ) fossil_panic("out of memory");
386386
return p;
387387
}
388
+
389
+/*
390
+** This function implements a cross-platform "system()" interface.
391
+*/
392
+int fossil_system(const char *zOrigCmd){
393
+ int rc;
394
+#if defined(_WIN32)
395
+ /* On windows, we have to put double-quotes around the entire command.
396
+ ** Who knows why - this is just the way windows works.
397
+ */
398
+ char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
399
+ rc = system(zNewCmd);
400
+ free(zNewCmd);
401
+#else
402
+ /* On unix, evaluate the command directly.
403
+ */
404
+ rc = system(zOrigCmd);
405
+#endif
406
+ return rc;
407
+}
408
+
388409
389410
390411
/*
391412
** Return a name for an SQLite error code
392413
*/
393414
--- src/main.c
+++ src/main.c
@@ -383,10 +383,31 @@
383 void *fossil_realloc(void *p, size_t n){
384 p = realloc(p, n);
385 if( p==0 ) fossil_panic("out of memory");
386 return p;
387 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
389
390 /*
391 ** Return a name for an SQLite error code
392 */
393
--- src/main.c
+++ src/main.c
@@ -383,10 +383,31 @@
383 void *fossil_realloc(void *p, size_t n){
384 p = realloc(p, n);
385 if( p==0 ) fossil_panic("out of memory");
386 return p;
387 }
388
389 /*
390 ** This function implements a cross-platform "system()" interface.
391 */
392 int fossil_system(const char *zOrigCmd){
393 int rc;
394 #if defined(_WIN32)
395 /* On windows, we have to put double-quotes around the entire command.
396 ** Who knows why - this is just the way windows works.
397 */
398 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
399 rc = system(zNewCmd);
400 free(zNewCmd);
401 #else
402 /* On unix, evaluate the command directly.
403 */
404 rc = system(zOrigCmd);
405 #endif
406 return rc;
407 }
408
409
410
411 /*
412 ** Return a name for an SQLite error code
413 */
414
+21
--- src/main.c
+++ src/main.c
@@ -383,10 +383,31 @@
383383
void *fossil_realloc(void *p, size_t n){
384384
p = realloc(p, n);
385385
if( p==0 ) fossil_panic("out of memory");
386386
return p;
387387
}
388
+
389
+/*
390
+** This function implements a cross-platform "system()" interface.
391
+*/
392
+int fossil_system(const char *zOrigCmd){
393
+ int rc;
394
+#if defined(_WIN32)
395
+ /* On windows, we have to put double-quotes around the entire command.
396
+ ** Who knows why - this is just the way windows works.
397
+ */
398
+ char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
399
+ rc = system(zNewCmd);
400
+ free(zNewCmd);
401
+#else
402
+ /* On unix, evaluate the command directly.
403
+ */
404
+ rc = system(zOrigCmd);
405
+#endif
406
+ return rc;
407
+}
408
+
388409
389410
390411
/*
391412
** Return a name for an SQLite error code
392413
*/
393414
--- src/main.c
+++ src/main.c
@@ -383,10 +383,31 @@
383 void *fossil_realloc(void *p, size_t n){
384 p = realloc(p, n);
385 if( p==0 ) fossil_panic("out of memory");
386 return p;
387 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
389
390 /*
391 ** Return a name for an SQLite error code
392 */
393
--- src/main.c
+++ src/main.c
@@ -383,10 +383,31 @@
383 void *fossil_realloc(void *p, size_t n){
384 p = realloc(p, n);
385 if( p==0 ) fossil_panic("out of memory");
386 return p;
387 }
388
389 /*
390 ** This function implements a cross-platform "system()" interface.
391 */
392 int fossil_system(const char *zOrigCmd){
393 int rc;
394 #if defined(_WIN32)
395 /* On windows, we have to put double-quotes around the entire command.
396 ** Who knows why - this is just the way windows works.
397 */
398 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
399 rc = system(zNewCmd);
400 free(zNewCmd);
401 #else
402 /* On unix, evaluate the command directly.
403 */
404 rc = system(zOrigCmd);
405 #endif
406 return rc;
407 }
408
409
410
411 /*
412 ** Return a name for an SQLite error code
413 */
414
--- src/rebuild.c
+++ src/rebuild.c
@@ -352,11 +352,13 @@
352352
*/
353353
void rebuild_database(void){
354354
int forceFlag;
355355
int randomizeFlag;
356356
int errCnt;
357
+ int omitVerify;
357358
359
+ omitVerify = find_option("noverify",0,0)!=0;
358360
forceFlag = find_option("force","f",0)!=0;
359361
randomizeFlag = find_option("randomize", 0, 0)!=0;
360362
if( g.argc==3 ){
361363
db_open_repository(g.argv[2]);
362364
}else{
@@ -373,10 +375,11 @@
373375
if( errCnt && !forceFlag ){
374376
printf("%d errors. Rolling back changes. Use --force to force a commit.\n",
375377
errCnt);
376378
db_end_transaction(1);
377379
}else{
380
+ if( omitVerify ) verify_cancel();
378381
db_end_transaction(0);
379382
}
380383
}
381384
382385
/*
383386
--- src/rebuild.c
+++ src/rebuild.c
@@ -352,11 +352,13 @@
352 */
353 void rebuild_database(void){
354 int forceFlag;
355 int randomizeFlag;
356 int errCnt;
 
357
 
358 forceFlag = find_option("force","f",0)!=0;
359 randomizeFlag = find_option("randomize", 0, 0)!=0;
360 if( g.argc==3 ){
361 db_open_repository(g.argv[2]);
362 }else{
@@ -373,10 +375,11 @@
373 if( errCnt && !forceFlag ){
374 printf("%d errors. Rolling back changes. Use --force to force a commit.\n",
375 errCnt);
376 db_end_transaction(1);
377 }else{
 
378 db_end_transaction(0);
379 }
380 }
381
382 /*
383
--- src/rebuild.c
+++ src/rebuild.c
@@ -352,11 +352,13 @@
352 */
353 void rebuild_database(void){
354 int forceFlag;
355 int randomizeFlag;
356 int errCnt;
357 int omitVerify;
358
359 omitVerify = find_option("noverify",0,0)!=0;
360 forceFlag = find_option("force","f",0)!=0;
361 randomizeFlag = find_option("randomize", 0, 0)!=0;
362 if( g.argc==3 ){
363 db_open_repository(g.argv[2]);
364 }else{
@@ -373,10 +375,11 @@
375 if( errCnt && !forceFlag ){
376 printf("%d errors. Rolling back changes. Use --force to force a commit.\n",
377 errCnt);
378 db_end_transaction(1);
379 }else{
380 if( omitVerify ) verify_cancel();
381 db_end_transaction(0);
382 }
383 }
384
385 /*
386
--- src/rebuild.c
+++ src/rebuild.c
@@ -352,11 +352,13 @@
352352
*/
353353
void rebuild_database(void){
354354
int forceFlag;
355355
int randomizeFlag;
356356
int errCnt;
357
+ int omitVerify;
357358
359
+ omitVerify = find_option("noverify",0,0)!=0;
358360
forceFlag = find_option("force","f",0)!=0;
359361
randomizeFlag = find_option("randomize", 0, 0)!=0;
360362
if( g.argc==3 ){
361363
db_open_repository(g.argv[2]);
362364
}else{
@@ -373,10 +375,11 @@
373375
if( errCnt && !forceFlag ){
374376
printf("%d errors. Rolling back changes. Use --force to force a commit.\n",
375377
errCnt);
376378
db_end_transaction(1);
377379
}else{
380
+ if( omitVerify ) verify_cancel();
378381
db_end_transaction(0);
379382
}
380383
}
381384
382385
/*
383386
--- src/rebuild.c
+++ src/rebuild.c
@@ -352,11 +352,13 @@
352 */
353 void rebuild_database(void){
354 int forceFlag;
355 int randomizeFlag;
356 int errCnt;
 
357
 
358 forceFlag = find_option("force","f",0)!=0;
359 randomizeFlag = find_option("randomize", 0, 0)!=0;
360 if( g.argc==3 ){
361 db_open_repository(g.argv[2]);
362 }else{
@@ -373,10 +375,11 @@
373 if( errCnt && !forceFlag ){
374 printf("%d errors. Rolling back changes. Use --force to force a commit.\n",
375 errCnt);
376 db_end_transaction(1);
377 }else{
 
378 db_end_transaction(0);
379 }
380 }
381
382 /*
383
--- src/rebuild.c
+++ src/rebuild.c
@@ -352,11 +352,13 @@
352 */
353 void rebuild_database(void){
354 int forceFlag;
355 int randomizeFlag;
356 int errCnt;
357 int omitVerify;
358
359 omitVerify = find_option("noverify",0,0)!=0;
360 forceFlag = find_option("force","f",0)!=0;
361 randomizeFlag = find_option("randomize", 0, 0)!=0;
362 if( g.argc==3 ){
363 db_open_repository(g.argv[2]);
364 }else{
@@ -373,10 +375,11 @@
375 if( errCnt && !forceFlag ){
376 printf("%d errors. Rolling back changes. Use --force to force a commit.\n",
377 errCnt);
378 db_end_transaction(1);
379 }else{
380 if( omitVerify ) verify_cancel();
381 db_end_transaction(0);
382 }
383 }
384
385 /*
386
+2 -2
--- src/winhttp.c
+++ src/winhttp.c
@@ -115,11 +115,11 @@
115115
inet_ntoa(p->addr.sin_addr), p->zNotFound
116116
);
117117
if( g.fHttpTrace ){
118118
fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119119
}
120
- portable_system(zCmd);
120
+ fossil_system(zCmd);
121121
in = fopen(zReplyFName, "rb");
122122
if( in ){
123123
if( g.fHttpTrace ){
124124
fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125125
}
@@ -203,11 +203,11 @@
203203
zTempPrefix = mprintf("fossil_server_P%d_", iPort);
204204
printf("Listening for HTTP requests on TCP port %d\n", iPort);
205205
if( zBrowser ){
206206
zBrowser = mprintf(zBrowser, iPort);
207207
printf("Launch webbrowser: %s\n", zBrowser);
208
- portable_system(zBrowser);
208
+ fossil_system(zBrowser);
209209
}
210210
printf("Type Ctrl-C to stop the HTTP server\n");
211211
for(;;){
212212
SOCKET client;
213213
SOCKADDR_IN client_addr;
214214
--- src/winhttp.c
+++ src/winhttp.c
@@ -115,11 +115,11 @@
115 inet_ntoa(p->addr.sin_addr), p->zNotFound
116 );
117 if( g.fHttpTrace ){
118 fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119 }
120 portable_system(zCmd);
121 in = fopen(zReplyFName, "rb");
122 if( in ){
123 if( g.fHttpTrace ){
124 fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125 }
@@ -203,11 +203,11 @@
203 zTempPrefix = mprintf("fossil_server_P%d_", iPort);
204 printf("Listening for HTTP requests on TCP port %d\n", iPort);
205 if( zBrowser ){
206 zBrowser = mprintf(zBrowser, iPort);
207 printf("Launch webbrowser: %s\n", zBrowser);
208 portable_system(zBrowser);
209 }
210 printf("Type Ctrl-C to stop the HTTP server\n");
211 for(;;){
212 SOCKET client;
213 SOCKADDR_IN client_addr;
214
--- src/winhttp.c
+++ src/winhttp.c
@@ -115,11 +115,11 @@
115 inet_ntoa(p->addr.sin_addr), p->zNotFound
116 );
117 if( g.fHttpTrace ){
118 fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119 }
120 fossil_system(zCmd);
121 in = fopen(zReplyFName, "rb");
122 if( in ){
123 if( g.fHttpTrace ){
124 fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125 }
@@ -203,11 +203,11 @@
203 zTempPrefix = mprintf("fossil_server_P%d_", iPort);
204 printf("Listening for HTTP requests on TCP port %d\n", iPort);
205 if( zBrowser ){
206 zBrowser = mprintf(zBrowser, iPort);
207 printf("Launch webbrowser: %s\n", zBrowser);
208 fossil_system(zBrowser);
209 }
210 printf("Type Ctrl-C to stop the HTTP server\n");
211 for(;;){
212 SOCKET client;
213 SOCKADDR_IN client_addr;
214
+2 -2
--- src/winhttp.c
+++ src/winhttp.c
@@ -115,11 +115,11 @@
115115
inet_ntoa(p->addr.sin_addr), p->zNotFound
116116
);
117117
if( g.fHttpTrace ){
118118
fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119119
}
120
- portable_system(zCmd);
120
+ fossil_system(zCmd);
121121
in = fopen(zReplyFName, "rb");
122122
if( in ){
123123
if( g.fHttpTrace ){
124124
fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125125
}
@@ -203,11 +203,11 @@
203203
zTempPrefix = mprintf("fossil_server_P%d_", iPort);
204204
printf("Listening for HTTP requests on TCP port %d\n", iPort);
205205
if( zBrowser ){
206206
zBrowser = mprintf(zBrowser, iPort);
207207
printf("Launch webbrowser: %s\n", zBrowser);
208
- portable_system(zBrowser);
208
+ fossil_system(zBrowser);
209209
}
210210
printf("Type Ctrl-C to stop the HTTP server\n");
211211
for(;;){
212212
SOCKET client;
213213
SOCKADDR_IN client_addr;
214214
--- src/winhttp.c
+++ src/winhttp.c
@@ -115,11 +115,11 @@
115 inet_ntoa(p->addr.sin_addr), p->zNotFound
116 );
117 if( g.fHttpTrace ){
118 fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119 }
120 portable_system(zCmd);
121 in = fopen(zReplyFName, "rb");
122 if( in ){
123 if( g.fHttpTrace ){
124 fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125 }
@@ -203,11 +203,11 @@
203 zTempPrefix = mprintf("fossil_server_P%d_", iPort);
204 printf("Listening for HTTP requests on TCP port %d\n", iPort);
205 if( zBrowser ){
206 zBrowser = mprintf(zBrowser, iPort);
207 printf("Launch webbrowser: %s\n", zBrowser);
208 portable_system(zBrowser);
209 }
210 printf("Type Ctrl-C to stop the HTTP server\n");
211 for(;;){
212 SOCKET client;
213 SOCKADDR_IN client_addr;
214
--- src/winhttp.c
+++ src/winhttp.c
@@ -115,11 +115,11 @@
115 inet_ntoa(p->addr.sin_addr), p->zNotFound
116 );
117 if( g.fHttpTrace ){
118 fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119 }
120 fossil_system(zCmd);
121 in = fopen(zReplyFName, "rb");
122 if( in ){
123 if( g.fHttpTrace ){
124 fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125 }
@@ -203,11 +203,11 @@
203 zTempPrefix = mprintf("fossil_server_P%d_", iPort);
204 printf("Listening for HTTP requests on TCP port %d\n", iPort);
205 if( zBrowser ){
206 zBrowser = mprintf(zBrowser, iPort);
207 printf("Launch webbrowser: %s\n", zBrowser);
208 fossil_system(zBrowser);
209 }
210 printf("Type Ctrl-C to stop the HTTP server\n");
211 for(;;){
212 SOCKET client;
213 SOCKADDR_IN client_addr;
214

Keyboard Shortcuts

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