Fossil SCM

merge trunk

jan.nijtmans 2012-09-04 12:36 eclipse-project merge
Commit 2050646c9f2fec763c019e809e6a0b33577d6727
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -165,11 +165,11 @@
165165
"\n"
166166
"Note: the local check-out has not been updated to the new\n"
167167
" branch. To begin working on the new branch, do this:\n"
168168
"\n"
169169
" %s update %s\n",
170
- fossil_nameofexe(), zBranch
170
+ g.argv[0], zBranch
171171
);
172172
}
173173
174174
175175
/* Commit */
176176
--- src/branch.c
+++ src/branch.c
@@ -165,11 +165,11 @@
165 "\n"
166 "Note: the local check-out has not been updated to the new\n"
167 " branch. To begin working on the new branch, do this:\n"
168 "\n"
169 " %s update %s\n",
170 fossil_nameofexe(), zBranch
171 );
172 }
173
174
175 /* Commit */
176
--- src/branch.c
+++ src/branch.c
@@ -165,11 +165,11 @@
165 "\n"
166 "Note: the local check-out has not been updated to the new\n"
167 " branch. To begin working on the new branch, do this:\n"
168 "\n"
169 " %s update %s\n",
170 g.argv[0], zBranch
171 );
172 }
173
174
175 /* Commit */
176
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -165,11 +165,11 @@
165165
"\n"
166166
"Note: the local check-out has not been updated to the new\n"
167167
" branch. To begin working on the new branch, do this:\n"
168168
"\n"
169169
" %s update %s\n",
170
- fossil_nameofexe(), zBranch
170
+ g.argv[0], zBranch
171171
);
172172
}
173173
174174
175175
/* Commit */
176176
--- src/branch.c
+++ src/branch.c
@@ -165,11 +165,11 @@
165 "\n"
166 "Note: the local check-out has not been updated to the new\n"
167 " branch. To begin working on the new branch, do this:\n"
168 "\n"
169 " %s update %s\n",
170 fossil_nameofexe(), zBranch
171 );
172 }
173
174
175 /* Commit */
176
--- src/branch.c
+++ src/branch.c
@@ -165,11 +165,11 @@
165 "\n"
166 "Note: the local check-out has not been updated to the new\n"
167 " branch. To begin working on the new branch, do this:\n"
168 "\n"
169 " %s update %s\n",
170 g.argv[0], zBranch
171 );
172 }
173
174
175 /* Commit */
176
+1 -1
--- src/configure.c
+++ src/configure.c
@@ -913,11 +913,11 @@
913913
}
914914
}
915915
db_end_transaction(0);
916916
fossil_print("Configuration reset to factory defaults.\n");
917917
fossil_print("To recover, use: %s %s import %s\n",
918
- fossil_nameofexe(), g.argv[1], zBackup);
918
+ g.argv[0], g.argv[1], zBackup);
919919
}else
920920
{
921921
fossil_fatal("METHOD should be one of:"
922922
" export import merge pull push reset");
923923
}
924924
--- src/configure.c
+++ src/configure.c
@@ -913,11 +913,11 @@
913 }
914 }
915 db_end_transaction(0);
916 fossil_print("Configuration reset to factory defaults.\n");
917 fossil_print("To recover, use: %s %s import %s\n",
918 fossil_nameofexe(), g.argv[1], zBackup);
919 }else
920 {
921 fossil_fatal("METHOD should be one of:"
922 " export import merge pull push reset");
923 }
924
--- src/configure.c
+++ src/configure.c
@@ -913,11 +913,11 @@
913 }
914 }
915 db_end_transaction(0);
916 fossil_print("Configuration reset to factory defaults.\n");
917 fossil_print("To recover, use: %s %s import %s\n",
918 g.argv[0], g.argv[1], zBackup);
919 }else
920 {
921 fossil_fatal("METHOD should be one of:"
922 " export import merge pull push reset");
923 }
924
+1 -1
--- src/configure.c
+++ src/configure.c
@@ -913,11 +913,11 @@
913913
}
914914
}
915915
db_end_transaction(0);
916916
fossil_print("Configuration reset to factory defaults.\n");
917917
fossil_print("To recover, use: %s %s import %s\n",
918
- fossil_nameofexe(), g.argv[1], zBackup);
918
+ g.argv[0], g.argv[1], zBackup);
919919
}else
920920
{
921921
fossil_fatal("METHOD should be one of:"
922922
" export import merge pull push reset");
923923
}
924924
--- src/configure.c
+++ src/configure.c
@@ -913,11 +913,11 @@
913 }
914 }
915 db_end_transaction(0);
916 fossil_print("Configuration reset to factory defaults.\n");
917 fossil_print("To recover, use: %s %s import %s\n",
918 fossil_nameofexe(), g.argv[1], zBackup);
919 }else
920 {
921 fossil_fatal("METHOD should be one of:"
922 " export import merge pull push reset");
923 }
924
--- src/configure.c
+++ src/configure.c
@@ -913,11 +913,11 @@
913 }
914 }
915 db_end_transaction(0);
916 fossil_print("Configuration reset to factory defaults.\n");
917 fossil_print("To recover, use: %s %s import %s\n",
918 g.argv[0], g.argv[1], zBackup);
919 }else
920 {
921 fossil_fatal("METHOD should be one of:"
922 " export import merge pull push reset");
923 }
924
+3 -1
--- src/db.c
+++ src/db.c
@@ -92,11 +92,13 @@
9292
g.cgiOutput = 0;
9393
cgi_printf("<h1>Database Error</h1>\n"
9494
"<pre>%h</pre><p>%s</p>", z, zRebuildMsg);
9595
cgi_reply();
9696
}else{
97
- fprintf(stderr, "%s: %s\n\n%s", fossil_nameofexe(), z, zRebuildMsg);
97
+ char *zOut = mprintf("%s: %s\n\n%s", g.argv[0], z, zRebuildMsg);
98
+ fossil_puts(zOut, 1);
99
+ fossil_free(zOut);
98100
}
99101
free(z);
100102
db_force_rollback();
101103
fossil_exit(rc);
102104
}
103105
--- src/db.c
+++ src/db.c
@@ -92,11 +92,13 @@
92 g.cgiOutput = 0;
93 cgi_printf("<h1>Database Error</h1>\n"
94 "<pre>%h</pre><p>%s</p>", z, zRebuildMsg);
95 cgi_reply();
96 }else{
97 fprintf(stderr, "%s: %s\n\n%s", fossil_nameofexe(), z, zRebuildMsg);
 
 
98 }
99 free(z);
100 db_force_rollback();
101 fossil_exit(rc);
102 }
103
--- src/db.c
+++ src/db.c
@@ -92,11 +92,13 @@
92 g.cgiOutput = 0;
93 cgi_printf("<h1>Database Error</h1>\n"
94 "<pre>%h</pre><p>%s</p>", z, zRebuildMsg);
95 cgi_reply();
96 }else{
97 char *zOut = mprintf("%s: %s\n\n%s", g.argv[0], z, zRebuildMsg);
98 fossil_puts(zOut, 1);
99 fossil_free(zOut);
100 }
101 free(z);
102 db_force_rollback();
103 fossil_exit(rc);
104 }
105
+3 -1
--- src/db.c
+++ src/db.c
@@ -92,11 +92,13 @@
9292
g.cgiOutput = 0;
9393
cgi_printf("<h1>Database Error</h1>\n"
9494
"<pre>%h</pre><p>%s</p>", z, zRebuildMsg);
9595
cgi_reply();
9696
}else{
97
- fprintf(stderr, "%s: %s\n\n%s", fossil_nameofexe(), z, zRebuildMsg);
97
+ char *zOut = mprintf("%s: %s\n\n%s", g.argv[0], z, zRebuildMsg);
98
+ fossil_puts(zOut, 1);
99
+ fossil_free(zOut);
98100
}
99101
free(z);
100102
db_force_rollback();
101103
fossil_exit(rc);
102104
}
103105
--- src/db.c
+++ src/db.c
@@ -92,11 +92,13 @@
92 g.cgiOutput = 0;
93 cgi_printf("<h1>Database Error</h1>\n"
94 "<pre>%h</pre><p>%s</p>", z, zRebuildMsg);
95 cgi_reply();
96 }else{
97 fprintf(stderr, "%s: %s\n\n%s", fossil_nameofexe(), z, zRebuildMsg);
 
 
98 }
99 free(z);
100 db_force_rollback();
101 fossil_exit(rc);
102 }
103
--- src/db.c
+++ src/db.c
@@ -92,11 +92,13 @@
92 g.cgiOutput = 0;
93 cgi_printf("<h1>Database Error</h1>\n"
94 "<pre>%h</pre><p>%s</p>", z, zRebuildMsg);
95 cgi_reply();
96 }else{
97 char *zOut = mprintf("%s: %s\n\n%s", g.argv[0], z, zRebuildMsg);
98 fossil_puts(zOut, 1);
99 fossil_free(zOut);
100 }
101 free(z);
102 db_force_rollback();
103 fossil_exit(rc);
104 }
105
+3 -3
--- src/json.c
+++ src/json.c
@@ -348,11 +348,11 @@
348348
if( 0 != rc ){
349349
cson_value_free( v );
350350
}
351351
assert( (0==rc) && "Adding item to GC failed." );
352352
if(0!=rc){
353
- fprintf(stderr,"%s: FATAL: alloc error.\n", fossil_nameofexe())
353
+ fprintf(stderr,"%s: FATAL: alloc error.\n", g.argv[0])
354354
/* reminder: allocation error is the only reasonable cause of
355355
error here, provided g.json.gc.a and v are not NULL.
356356
*/
357357
;
358358
fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere
@@ -1104,11 +1104,11 @@
11041104
if(!jfile || !*jfile){
11051105
break;
11061106
}
11071107
inFile = (0==strcmp("-",jfile))
11081108
? stdin
1109
- : fossil_fopen(jfile,"rb");
1109
+ : fopen(jfile,"rb");
11101110
if(!inFile){
11111111
g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
11121112
fossil_fatal("Could not open JSON file [%s].",jfile)
11131113
/* Does not return. */
11141114
;
@@ -1628,11 +1628,11 @@
16281628
if(!resp){
16291629
/* about the only error case here is out-of-memory. DO NOT
16301630
call fossil_panic() here because that calls this function.
16311631
*/
16321632
fprintf(stderr, "%s: Fatal error: could not allocate "
1633
- "response object.\n", fossil_nameofexe());
1633
+ "response object.\n", g.argv[0]);
16341634
fossil_exit(1);
16351635
}
16361636
if( g.isHTTP ){
16371637
if(alsoOutput){
16381638
json_send_response(resp);
16391639
--- src/json.c
+++ src/json.c
@@ -348,11 +348,11 @@
348 if( 0 != rc ){
349 cson_value_free( v );
350 }
351 assert( (0==rc) && "Adding item to GC failed." );
352 if(0!=rc){
353 fprintf(stderr,"%s: FATAL: alloc error.\n", fossil_nameofexe())
354 /* reminder: allocation error is the only reasonable cause of
355 error here, provided g.json.gc.a and v are not NULL.
356 */
357 ;
358 fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere
@@ -1104,11 +1104,11 @@
1104 if(!jfile || !*jfile){
1105 break;
1106 }
1107 inFile = (0==strcmp("-",jfile))
1108 ? stdin
1109 : fossil_fopen(jfile,"rb");
1110 if(!inFile){
1111 g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1112 fossil_fatal("Could not open JSON file [%s].",jfile)
1113 /* Does not return. */
1114 ;
@@ -1628,11 +1628,11 @@
1628 if(!resp){
1629 /* about the only error case here is out-of-memory. DO NOT
1630 call fossil_panic() here because that calls this function.
1631 */
1632 fprintf(stderr, "%s: Fatal error: could not allocate "
1633 "response object.\n", fossil_nameofexe());
1634 fossil_exit(1);
1635 }
1636 if( g.isHTTP ){
1637 if(alsoOutput){
1638 json_send_response(resp);
1639
--- src/json.c
+++ src/json.c
@@ -348,11 +348,11 @@
348 if( 0 != rc ){
349 cson_value_free( v );
350 }
351 assert( (0==rc) && "Adding item to GC failed." );
352 if(0!=rc){
353 fprintf(stderr,"%s: FATAL: alloc error.\n", g.argv[0])
354 /* reminder: allocation error is the only reasonable cause of
355 error here, provided g.json.gc.a and v are not NULL.
356 */
357 ;
358 fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere
@@ -1104,11 +1104,11 @@
1104 if(!jfile || !*jfile){
1105 break;
1106 }
1107 inFile = (0==strcmp("-",jfile))
1108 ? stdin
1109 : fopen(jfile,"rb");
1110 if(!inFile){
1111 g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1112 fossil_fatal("Could not open JSON file [%s].",jfile)
1113 /* Does not return. */
1114 ;
@@ -1628,11 +1628,11 @@
1628 if(!resp){
1629 /* about the only error case here is out-of-memory. DO NOT
1630 call fossil_panic() here because that calls this function.
1631 */
1632 fprintf(stderr, "%s: Fatal error: could not allocate "
1633 "response object.\n", g.argv[0]);
1634 fossil_exit(1);
1635 }
1636 if( g.isHTTP ){
1637 if(alsoOutput){
1638 json_send_response(resp);
1639
+3 -3
--- src/json.c
+++ src/json.c
@@ -348,11 +348,11 @@
348348
if( 0 != rc ){
349349
cson_value_free( v );
350350
}
351351
assert( (0==rc) && "Adding item to GC failed." );
352352
if(0!=rc){
353
- fprintf(stderr,"%s: FATAL: alloc error.\n", fossil_nameofexe())
353
+ fprintf(stderr,"%s: FATAL: alloc error.\n", g.argv[0])
354354
/* reminder: allocation error is the only reasonable cause of
355355
error here, provided g.json.gc.a and v are not NULL.
356356
*/
357357
;
358358
fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere
@@ -1104,11 +1104,11 @@
11041104
if(!jfile || !*jfile){
11051105
break;
11061106
}
11071107
inFile = (0==strcmp("-",jfile))
11081108
? stdin
1109
- : fossil_fopen(jfile,"rb");
1109
+ : fopen(jfile,"rb");
11101110
if(!inFile){
11111111
g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
11121112
fossil_fatal("Could not open JSON file [%s].",jfile)
11131113
/* Does not return. */
11141114
;
@@ -1628,11 +1628,11 @@
16281628
if(!resp){
16291629
/* about the only error case here is out-of-memory. DO NOT
16301630
call fossil_panic() here because that calls this function.
16311631
*/
16321632
fprintf(stderr, "%s: Fatal error: could not allocate "
1633
- "response object.\n", fossil_nameofexe());
1633
+ "response object.\n", g.argv[0]);
16341634
fossil_exit(1);
16351635
}
16361636
if( g.isHTTP ){
16371637
if(alsoOutput){
16381638
json_send_response(resp);
16391639
--- src/json.c
+++ src/json.c
@@ -348,11 +348,11 @@
348 if( 0 != rc ){
349 cson_value_free( v );
350 }
351 assert( (0==rc) && "Adding item to GC failed." );
352 if(0!=rc){
353 fprintf(stderr,"%s: FATAL: alloc error.\n", fossil_nameofexe())
354 /* reminder: allocation error is the only reasonable cause of
355 error here, provided g.json.gc.a and v are not NULL.
356 */
357 ;
358 fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere
@@ -1104,11 +1104,11 @@
1104 if(!jfile || !*jfile){
1105 break;
1106 }
1107 inFile = (0==strcmp("-",jfile))
1108 ? stdin
1109 : fossil_fopen(jfile,"rb");
1110 if(!inFile){
1111 g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1112 fossil_fatal("Could not open JSON file [%s].",jfile)
1113 /* Does not return. */
1114 ;
@@ -1628,11 +1628,11 @@
1628 if(!resp){
1629 /* about the only error case here is out-of-memory. DO NOT
1630 call fossil_panic() here because that calls this function.
1631 */
1632 fprintf(stderr, "%s: Fatal error: could not allocate "
1633 "response object.\n", fossil_nameofexe());
1634 fossil_exit(1);
1635 }
1636 if( g.isHTTP ){
1637 if(alsoOutput){
1638 json_send_response(resp);
1639
--- src/json.c
+++ src/json.c
@@ -348,11 +348,11 @@
348 if( 0 != rc ){
349 cson_value_free( v );
350 }
351 assert( (0==rc) && "Adding item to GC failed." );
352 if(0!=rc){
353 fprintf(stderr,"%s: FATAL: alloc error.\n", g.argv[0])
354 /* reminder: allocation error is the only reasonable cause of
355 error here, provided g.json.gc.a and v are not NULL.
356 */
357 ;
358 fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere
@@ -1104,11 +1104,11 @@
1104 if(!jfile || !*jfile){
1105 break;
1106 }
1107 inFile = (0==strcmp("-",jfile))
1108 ? stdin
1109 : fopen(jfile,"rb");
1110 if(!inFile){
1111 g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED;
1112 fossil_fatal("Could not open JSON file [%s].",jfile)
1113 /* Does not return. */
1114 ;
@@ -1628,11 +1628,11 @@
1628 if(!resp){
1629 /* about the only error case here is out-of-memory. DO NOT
1630 call fossil_panic() here because that calls this function.
1631 */
1632 fprintf(stderr, "%s: Fatal error: could not allocate "
1633 "response object.\n", g.argv[0]);
1634 fossil_exit(1);
1635 }
1636 if( g.isHTTP ){
1637 if(alsoOutput){
1638 json_send_response(resp);
1639
+21 -15
--- src/main.c
+++ src/main.c
@@ -583,12 +583,13 @@
583583
if( g.cgiOutput && once ){
584584
once = 0;
585585
cgi_printf("<p class=\"generalError\">%h</p>", z);
586586
cgi_reply();
587587
}else if( !g.fQuiet ){
588
- char *zOut = mprintf("%s: %s\n", fossil_nameofexe(), z);
588
+ char *zOut = mprintf("%s: %s\n", g.argv[0], z);
589589
fossil_puts(zOut, 1);
590
+ fossil_free(zOut);
590591
}
591592
}
592593
free(z);
593594
db_force_rollback();
594595
fossil_exit(rc);
@@ -615,12 +616,13 @@
615616
if( g.cgiOutput ){
616617
g.cgiOutput = 0;
617618
cgi_printf("<p class=\"generalError\">%h</p>", z);
618619
cgi_reply();
619620
}else if( !g.fQuiet ){
620
- char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
621
+ char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
621622
fossil_puts(zOut, 1);
623
+ fossil_free(zOut);
622624
}
623625
}
624626
free(z);
625627
db_force_rollback();
626628
fossil_exit(rc);
@@ -656,13 +658,13 @@
656658
if( g.cgiOutput ){
657659
g.cgiOutput = 0;
658660
cgi_printf("<p class=\"generalError\">%h</p>", z);
659661
cgi_reply();
660662
}else{
661
- char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
663
+ char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
662664
fossil_puts(zOut, 1);
663
- free(zOut);
665
+ fossil_free(zOut);
664666
}
665667
}
666668
db_force_rollback();
667669
fossil_exit(rc);
668670
}
@@ -682,13 +684,13 @@
682684
#endif
683685
{
684686
if( g.cgiOutput ){
685687
cgi_printf("<p class=\"generalError\">%h</p>", z);
686688
}else{
687
- char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
689
+ char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
688690
fossil_puts(zOut, 1);
689
- free(zOut);
691
+ fossil_free(zOut);
690692
}
691693
}
692694
free(z);
693695
}
694696
@@ -717,14 +719,18 @@
717719
#if defined(_WIN32)
718720
/* On windows, we have to put double-quotes around the entire command.
719721
** Who knows why - this is just the way windows works.
720722
*/
721723
char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
722
- wchar_t *zMbcs = fossil_utf8_to_unicode(zNewCmd);
723
- if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zNewCmd);
724
- rc = _wsystem(zMbcs);
725
- fossil_mbcs_free(zMbcs);
724
+ wchar_t *zUnicode = fossil_utf8_to_unicode(zNewCmd);
725
+ if( g.fSystemTrace ) {
726
+ char *zOut = mprintf("SYSTEM: %s\n", zNewCmd);
727
+ fossil_puts(zOut, 1);
728
+ fossil_free(zOut);
729
+ }
730
+ rc = _wsystem(zUnicode);
731
+ fossil_mbcs_free(zUnicode);
726732
free(zNewCmd);
727733
#else
728734
/* On unix, evaluate the command directly.
729735
*/
730736
if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
@@ -790,11 +796,11 @@
790796
791797
/*
792798
** Print a usage comment and quit
793799
*/
794800
void usage(const char *zFormat){
795
- fossil_fatal("Usage: %s %s %s\n", fossil_nameofexe(), g.argv[1], zFormat);
801
+ fossil_fatal("Usage: %s %s %s\n", g.argv[0], g.argv[1], zFormat);
796802
}
797803
798804
/*
799805
** Remove n elements from g.argv beginning with the i-th element.
800806
*/
@@ -951,11 +957,11 @@
951957
*/
952958
void help_cmd(void){
953959
int rc, idx;
954960
const char *z;
955961
if( g.argc<3 ){
956
- z = fossil_nameofexe();
962
+ z = g.argv[0];
957963
fossil_print(
958964
"Usage: %s help COMMAND\n"
959965
"Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
960966
z, z);
961967
command_list(0, CMDFLAG_1ST_TIER);
@@ -990,11 +996,11 @@
990996
fossil_fatal("no help available for the %s command",
991997
aCommand[idx].zName);
992998
}
993999
while( *z ){
9941000
if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
995
- fossil_print("%s", fossil_nameofexe());
1001
+ fossil_print("%s", g.argv[0]);
9961002
z += 7;
9971003
}else{
9981004
putchar(*z);
9991005
z++;
10001006
}
@@ -1037,11 +1043,11 @@
10371043
}
10381044
*d = 0;
10391045
@ <blockquote><pre>
10401046
@ %h(z)
10411047
@ </pre></blockquote>
1042
- free(z);
1048
+ fossil_free(z);
10431049
}
10441050
}
10451051
}else{
10461052
int i, j, n;
10471053
@@ -1696,11 +1702,11 @@
16961702
while( zPath && zPath[0] ){
16971703
while( zPath[0]==':' ) zPath++;
16981704
for(i=0; zPath[i] && zPath[i]!=':'; i++){}
16991705
zFull = mprintf("%.*s/%s", i, zPath, zBinary);
17001706
bExists = file_access(zFull, X_OK);
1701
- free(zFull);
1707
+ fossil_free(zFull);
17021708
if( bExists==0 ) return 1;
17031709
zPath += i;
17041710
}
17051711
return 0;
17061712
}
17071713
--- src/main.c
+++ src/main.c
@@ -583,12 +583,13 @@
583 if( g.cgiOutput && once ){
584 once = 0;
585 cgi_printf("<p class=\"generalError\">%h</p>", z);
586 cgi_reply();
587 }else if( !g.fQuiet ){
588 char *zOut = mprintf("%s: %s\n", fossil_nameofexe(), z);
589 fossil_puts(zOut, 1);
 
590 }
591 }
592 free(z);
593 db_force_rollback();
594 fossil_exit(rc);
@@ -615,12 +616,13 @@
615 if( g.cgiOutput ){
616 g.cgiOutput = 0;
617 cgi_printf("<p class=\"generalError\">%h</p>", z);
618 cgi_reply();
619 }else if( !g.fQuiet ){
620 char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
621 fossil_puts(zOut, 1);
 
622 }
623 }
624 free(z);
625 db_force_rollback();
626 fossil_exit(rc);
@@ -656,13 +658,13 @@
656 if( g.cgiOutput ){
657 g.cgiOutput = 0;
658 cgi_printf("<p class=\"generalError\">%h</p>", z);
659 cgi_reply();
660 }else{
661 char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
662 fossil_puts(zOut, 1);
663 free(zOut);
664 }
665 }
666 db_force_rollback();
667 fossil_exit(rc);
668 }
@@ -682,13 +684,13 @@
682 #endif
683 {
684 if( g.cgiOutput ){
685 cgi_printf("<p class=\"generalError\">%h</p>", z);
686 }else{
687 char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
688 fossil_puts(zOut, 1);
689 free(zOut);
690 }
691 }
692 free(z);
693 }
694
@@ -717,14 +719,18 @@
717 #if defined(_WIN32)
718 /* On windows, we have to put double-quotes around the entire command.
719 ** Who knows why - this is just the way windows works.
720 */
721 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
722 wchar_t *zMbcs = fossil_utf8_to_unicode(zNewCmd);
723 if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zNewCmd);
724 rc = _wsystem(zMbcs);
725 fossil_mbcs_free(zMbcs);
 
 
 
 
726 free(zNewCmd);
727 #else
728 /* On unix, evaluate the command directly.
729 */
730 if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
@@ -790,11 +796,11 @@
790
791 /*
792 ** Print a usage comment and quit
793 */
794 void usage(const char *zFormat){
795 fossil_fatal("Usage: %s %s %s\n", fossil_nameofexe(), g.argv[1], zFormat);
796 }
797
798 /*
799 ** Remove n elements from g.argv beginning with the i-th element.
800 */
@@ -951,11 +957,11 @@
951 */
952 void help_cmd(void){
953 int rc, idx;
954 const char *z;
955 if( g.argc<3 ){
956 z = fossil_nameofexe();
957 fossil_print(
958 "Usage: %s help COMMAND\n"
959 "Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
960 z, z);
961 command_list(0, CMDFLAG_1ST_TIER);
@@ -990,11 +996,11 @@
990 fossil_fatal("no help available for the %s command",
991 aCommand[idx].zName);
992 }
993 while( *z ){
994 if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
995 fossil_print("%s", fossil_nameofexe());
996 z += 7;
997 }else{
998 putchar(*z);
999 z++;
1000 }
@@ -1037,11 +1043,11 @@
1037 }
1038 *d = 0;
1039 @ <blockquote><pre>
1040 @ %h(z)
1041 @ </pre></blockquote>
1042 free(z);
1043 }
1044 }
1045 }else{
1046 int i, j, n;
1047
@@ -1696,11 +1702,11 @@
1696 while( zPath && zPath[0] ){
1697 while( zPath[0]==':' ) zPath++;
1698 for(i=0; zPath[i] && zPath[i]!=':'; i++){}
1699 zFull = mprintf("%.*s/%s", i, zPath, zBinary);
1700 bExists = file_access(zFull, X_OK);
1701 free(zFull);
1702 if( bExists==0 ) return 1;
1703 zPath += i;
1704 }
1705 return 0;
1706 }
1707
--- src/main.c
+++ src/main.c
@@ -583,12 +583,13 @@
583 if( g.cgiOutput && once ){
584 once = 0;
585 cgi_printf("<p class=\"generalError\">%h</p>", z);
586 cgi_reply();
587 }else if( !g.fQuiet ){
588 char *zOut = mprintf("%s: %s\n", g.argv[0], z);
589 fossil_puts(zOut, 1);
590 fossil_free(zOut);
591 }
592 }
593 free(z);
594 db_force_rollback();
595 fossil_exit(rc);
@@ -615,12 +616,13 @@
616 if( g.cgiOutput ){
617 g.cgiOutput = 0;
618 cgi_printf("<p class=\"generalError\">%h</p>", z);
619 cgi_reply();
620 }else if( !g.fQuiet ){
621 char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
622 fossil_puts(zOut, 1);
623 fossil_free(zOut);
624 }
625 }
626 free(z);
627 db_force_rollback();
628 fossil_exit(rc);
@@ -656,13 +658,13 @@
658 if( g.cgiOutput ){
659 g.cgiOutput = 0;
660 cgi_printf("<p class=\"generalError\">%h</p>", z);
661 cgi_reply();
662 }else{
663 char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
664 fossil_puts(zOut, 1);
665 fossil_free(zOut);
666 }
667 }
668 db_force_rollback();
669 fossil_exit(rc);
670 }
@@ -682,13 +684,13 @@
684 #endif
685 {
686 if( g.cgiOutput ){
687 cgi_printf("<p class=\"generalError\">%h</p>", z);
688 }else{
689 char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
690 fossil_puts(zOut, 1);
691 fossil_free(zOut);
692 }
693 }
694 free(z);
695 }
696
@@ -717,14 +719,18 @@
719 #if defined(_WIN32)
720 /* On windows, we have to put double-quotes around the entire command.
721 ** Who knows why - this is just the way windows works.
722 */
723 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
724 wchar_t *zUnicode = fossil_utf8_to_unicode(zNewCmd);
725 if( g.fSystemTrace ) {
726 char *zOut = mprintf("SYSTEM: %s\n", zNewCmd);
727 fossil_puts(zOut, 1);
728 fossil_free(zOut);
729 }
730 rc = _wsystem(zUnicode);
731 fossil_mbcs_free(zUnicode);
732 free(zNewCmd);
733 #else
734 /* On unix, evaluate the command directly.
735 */
736 if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
@@ -790,11 +796,11 @@
796
797 /*
798 ** Print a usage comment and quit
799 */
800 void usage(const char *zFormat){
801 fossil_fatal("Usage: %s %s %s\n", g.argv[0], g.argv[1], zFormat);
802 }
803
804 /*
805 ** Remove n elements from g.argv beginning with the i-th element.
806 */
@@ -951,11 +957,11 @@
957 */
958 void help_cmd(void){
959 int rc, idx;
960 const char *z;
961 if( g.argc<3 ){
962 z = g.argv[0];
963 fossil_print(
964 "Usage: %s help COMMAND\n"
965 "Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
966 z, z);
967 command_list(0, CMDFLAG_1ST_TIER);
@@ -990,11 +996,11 @@
996 fossil_fatal("no help available for the %s command",
997 aCommand[idx].zName);
998 }
999 while( *z ){
1000 if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
1001 fossil_print("%s", g.argv[0]);
1002 z += 7;
1003 }else{
1004 putchar(*z);
1005 z++;
1006 }
@@ -1037,11 +1043,11 @@
1043 }
1044 *d = 0;
1045 @ <blockquote><pre>
1046 @ %h(z)
1047 @ </pre></blockquote>
1048 fossil_free(z);
1049 }
1050 }
1051 }else{
1052 int i, j, n;
1053
@@ -1696,11 +1702,11 @@
1702 while( zPath && zPath[0] ){
1703 while( zPath[0]==':' ) zPath++;
1704 for(i=0; zPath[i] && zPath[i]!=':'; i++){}
1705 zFull = mprintf("%.*s/%s", i, zPath, zBinary);
1706 bExists = file_access(zFull, X_OK);
1707 fossil_free(zFull);
1708 if( bExists==0 ) return 1;
1709 zPath += i;
1710 }
1711 return 0;
1712 }
1713
+21 -15
--- src/main.c
+++ src/main.c
@@ -583,12 +583,13 @@
583583
if( g.cgiOutput && once ){
584584
once = 0;
585585
cgi_printf("<p class=\"generalError\">%h</p>", z);
586586
cgi_reply();
587587
}else if( !g.fQuiet ){
588
- char *zOut = mprintf("%s: %s\n", fossil_nameofexe(), z);
588
+ char *zOut = mprintf("%s: %s\n", g.argv[0], z);
589589
fossil_puts(zOut, 1);
590
+ fossil_free(zOut);
590591
}
591592
}
592593
free(z);
593594
db_force_rollback();
594595
fossil_exit(rc);
@@ -615,12 +616,13 @@
615616
if( g.cgiOutput ){
616617
g.cgiOutput = 0;
617618
cgi_printf("<p class=\"generalError\">%h</p>", z);
618619
cgi_reply();
619620
}else if( !g.fQuiet ){
620
- char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
621
+ char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
621622
fossil_puts(zOut, 1);
623
+ fossil_free(zOut);
622624
}
623625
}
624626
free(z);
625627
db_force_rollback();
626628
fossil_exit(rc);
@@ -656,13 +658,13 @@
656658
if( g.cgiOutput ){
657659
g.cgiOutput = 0;
658660
cgi_printf("<p class=\"generalError\">%h</p>", z);
659661
cgi_reply();
660662
}else{
661
- char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
663
+ char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
662664
fossil_puts(zOut, 1);
663
- free(zOut);
665
+ fossil_free(zOut);
664666
}
665667
}
666668
db_force_rollback();
667669
fossil_exit(rc);
668670
}
@@ -682,13 +684,13 @@
682684
#endif
683685
{
684686
if( g.cgiOutput ){
685687
cgi_printf("<p class=\"generalError\">%h</p>", z);
686688
}else{
687
- char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
689
+ char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
688690
fossil_puts(zOut, 1);
689
- free(zOut);
691
+ fossil_free(zOut);
690692
}
691693
}
692694
free(z);
693695
}
694696
@@ -717,14 +719,18 @@
717719
#if defined(_WIN32)
718720
/* On windows, we have to put double-quotes around the entire command.
719721
** Who knows why - this is just the way windows works.
720722
*/
721723
char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
722
- wchar_t *zMbcs = fossil_utf8_to_unicode(zNewCmd);
723
- if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zNewCmd);
724
- rc = _wsystem(zMbcs);
725
- fossil_mbcs_free(zMbcs);
724
+ wchar_t *zUnicode = fossil_utf8_to_unicode(zNewCmd);
725
+ if( g.fSystemTrace ) {
726
+ char *zOut = mprintf("SYSTEM: %s\n", zNewCmd);
727
+ fossil_puts(zOut, 1);
728
+ fossil_free(zOut);
729
+ }
730
+ rc = _wsystem(zUnicode);
731
+ fossil_mbcs_free(zUnicode);
726732
free(zNewCmd);
727733
#else
728734
/* On unix, evaluate the command directly.
729735
*/
730736
if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
@@ -790,11 +796,11 @@
790796
791797
/*
792798
** Print a usage comment and quit
793799
*/
794800
void usage(const char *zFormat){
795
- fossil_fatal("Usage: %s %s %s\n", fossil_nameofexe(), g.argv[1], zFormat);
801
+ fossil_fatal("Usage: %s %s %s\n", g.argv[0], g.argv[1], zFormat);
796802
}
797803
798804
/*
799805
** Remove n elements from g.argv beginning with the i-th element.
800806
*/
@@ -951,11 +957,11 @@
951957
*/
952958
void help_cmd(void){
953959
int rc, idx;
954960
const char *z;
955961
if( g.argc<3 ){
956
- z = fossil_nameofexe();
962
+ z = g.argv[0];
957963
fossil_print(
958964
"Usage: %s help COMMAND\n"
959965
"Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
960966
z, z);
961967
command_list(0, CMDFLAG_1ST_TIER);
@@ -990,11 +996,11 @@
990996
fossil_fatal("no help available for the %s command",
991997
aCommand[idx].zName);
992998
}
993999
while( *z ){
9941000
if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
995
- fossil_print("%s", fossil_nameofexe());
1001
+ fossil_print("%s", g.argv[0]);
9961002
z += 7;
9971003
}else{
9981004
putchar(*z);
9991005
z++;
10001006
}
@@ -1037,11 +1043,11 @@
10371043
}
10381044
*d = 0;
10391045
@ <blockquote><pre>
10401046
@ %h(z)
10411047
@ </pre></blockquote>
1042
- free(z);
1048
+ fossil_free(z);
10431049
}
10441050
}
10451051
}else{
10461052
int i, j, n;
10471053
@@ -1696,11 +1702,11 @@
16961702
while( zPath && zPath[0] ){
16971703
while( zPath[0]==':' ) zPath++;
16981704
for(i=0; zPath[i] && zPath[i]!=':'; i++){}
16991705
zFull = mprintf("%.*s/%s", i, zPath, zBinary);
17001706
bExists = file_access(zFull, X_OK);
1701
- free(zFull);
1707
+ fossil_free(zFull);
17021708
if( bExists==0 ) return 1;
17031709
zPath += i;
17041710
}
17051711
return 0;
17061712
}
17071713
--- src/main.c
+++ src/main.c
@@ -583,12 +583,13 @@
583 if( g.cgiOutput && once ){
584 once = 0;
585 cgi_printf("<p class=\"generalError\">%h</p>", z);
586 cgi_reply();
587 }else if( !g.fQuiet ){
588 char *zOut = mprintf("%s: %s\n", fossil_nameofexe(), z);
589 fossil_puts(zOut, 1);
 
590 }
591 }
592 free(z);
593 db_force_rollback();
594 fossil_exit(rc);
@@ -615,12 +616,13 @@
615 if( g.cgiOutput ){
616 g.cgiOutput = 0;
617 cgi_printf("<p class=\"generalError\">%h</p>", z);
618 cgi_reply();
619 }else if( !g.fQuiet ){
620 char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
621 fossil_puts(zOut, 1);
 
622 }
623 }
624 free(z);
625 db_force_rollback();
626 fossil_exit(rc);
@@ -656,13 +658,13 @@
656 if( g.cgiOutput ){
657 g.cgiOutput = 0;
658 cgi_printf("<p class=\"generalError\">%h</p>", z);
659 cgi_reply();
660 }else{
661 char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
662 fossil_puts(zOut, 1);
663 free(zOut);
664 }
665 }
666 db_force_rollback();
667 fossil_exit(rc);
668 }
@@ -682,13 +684,13 @@
682 #endif
683 {
684 if( g.cgiOutput ){
685 cgi_printf("<p class=\"generalError\">%h</p>", z);
686 }else{
687 char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z);
688 fossil_puts(zOut, 1);
689 free(zOut);
690 }
691 }
692 free(z);
693 }
694
@@ -717,14 +719,18 @@
717 #if defined(_WIN32)
718 /* On windows, we have to put double-quotes around the entire command.
719 ** Who knows why - this is just the way windows works.
720 */
721 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
722 wchar_t *zMbcs = fossil_utf8_to_unicode(zNewCmd);
723 if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zNewCmd);
724 rc = _wsystem(zMbcs);
725 fossil_mbcs_free(zMbcs);
 
 
 
 
726 free(zNewCmd);
727 #else
728 /* On unix, evaluate the command directly.
729 */
730 if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
@@ -790,11 +796,11 @@
790
791 /*
792 ** Print a usage comment and quit
793 */
794 void usage(const char *zFormat){
795 fossil_fatal("Usage: %s %s %s\n", fossil_nameofexe(), g.argv[1], zFormat);
796 }
797
798 /*
799 ** Remove n elements from g.argv beginning with the i-th element.
800 */
@@ -951,11 +957,11 @@
951 */
952 void help_cmd(void){
953 int rc, idx;
954 const char *z;
955 if( g.argc<3 ){
956 z = fossil_nameofexe();
957 fossil_print(
958 "Usage: %s help COMMAND\n"
959 "Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
960 z, z);
961 command_list(0, CMDFLAG_1ST_TIER);
@@ -990,11 +996,11 @@
990 fossil_fatal("no help available for the %s command",
991 aCommand[idx].zName);
992 }
993 while( *z ){
994 if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
995 fossil_print("%s", fossil_nameofexe());
996 z += 7;
997 }else{
998 putchar(*z);
999 z++;
1000 }
@@ -1037,11 +1043,11 @@
1037 }
1038 *d = 0;
1039 @ <blockquote><pre>
1040 @ %h(z)
1041 @ </pre></blockquote>
1042 free(z);
1043 }
1044 }
1045 }else{
1046 int i, j, n;
1047
@@ -1696,11 +1702,11 @@
1696 while( zPath && zPath[0] ){
1697 while( zPath[0]==':' ) zPath++;
1698 for(i=0; zPath[i] && zPath[i]!=':'; i++){}
1699 zFull = mprintf("%.*s/%s", i, zPath, zBinary);
1700 bExists = file_access(zFull, X_OK);
1701 free(zFull);
1702 if( bExists==0 ) return 1;
1703 zPath += i;
1704 }
1705 return 0;
1706 }
1707
--- src/main.c
+++ src/main.c
@@ -583,12 +583,13 @@
583 if( g.cgiOutput && once ){
584 once = 0;
585 cgi_printf("<p class=\"generalError\">%h</p>", z);
586 cgi_reply();
587 }else if( !g.fQuiet ){
588 char *zOut = mprintf("%s: %s\n", g.argv[0], z);
589 fossil_puts(zOut, 1);
590 fossil_free(zOut);
591 }
592 }
593 free(z);
594 db_force_rollback();
595 fossil_exit(rc);
@@ -615,12 +616,13 @@
616 if( g.cgiOutput ){
617 g.cgiOutput = 0;
618 cgi_printf("<p class=\"generalError\">%h</p>", z);
619 cgi_reply();
620 }else if( !g.fQuiet ){
621 char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
622 fossil_puts(zOut, 1);
623 fossil_free(zOut);
624 }
625 }
626 free(z);
627 db_force_rollback();
628 fossil_exit(rc);
@@ -656,13 +658,13 @@
658 if( g.cgiOutput ){
659 g.cgiOutput = 0;
660 cgi_printf("<p class=\"generalError\">%h</p>", z);
661 cgi_reply();
662 }else{
663 char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
664 fossil_puts(zOut, 1);
665 fossil_free(zOut);
666 }
667 }
668 db_force_rollback();
669 fossil_exit(rc);
670 }
@@ -682,13 +684,13 @@
684 #endif
685 {
686 if( g.cgiOutput ){
687 cgi_printf("<p class=\"generalError\">%h</p>", z);
688 }else{
689 char *zOut = mprintf("\r%s: %s\n", g.argv[0], z);
690 fossil_puts(zOut, 1);
691 fossil_free(zOut);
692 }
693 }
694 free(z);
695 }
696
@@ -717,14 +719,18 @@
719 #if defined(_WIN32)
720 /* On windows, we have to put double-quotes around the entire command.
721 ** Who knows why - this is just the way windows works.
722 */
723 char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
724 wchar_t *zUnicode = fossil_utf8_to_unicode(zNewCmd);
725 if( g.fSystemTrace ) {
726 char *zOut = mprintf("SYSTEM: %s\n", zNewCmd);
727 fossil_puts(zOut, 1);
728 fossil_free(zOut);
729 }
730 rc = _wsystem(zUnicode);
731 fossil_mbcs_free(zUnicode);
732 free(zNewCmd);
733 #else
734 /* On unix, evaluate the command directly.
735 */
736 if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
@@ -790,11 +796,11 @@
796
797 /*
798 ** Print a usage comment and quit
799 */
800 void usage(const char *zFormat){
801 fossil_fatal("Usage: %s %s %s\n", g.argv[0], g.argv[1], zFormat);
802 }
803
804 /*
805 ** Remove n elements from g.argv beginning with the i-th element.
806 */
@@ -951,11 +957,11 @@
957 */
958 void help_cmd(void){
959 int rc, idx;
960 const char *z;
961 if( g.argc<3 ){
962 z = g.argv[0];
963 fossil_print(
964 "Usage: %s help COMMAND\n"
965 "Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
966 z, z);
967 command_list(0, CMDFLAG_1ST_TIER);
@@ -990,11 +996,11 @@
996 fossil_fatal("no help available for the %s command",
997 aCommand[idx].zName);
998 }
999 while( *z ){
1000 if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
1001 fossil_print("%s", g.argv[0]);
1002 z += 7;
1003 }else{
1004 putchar(*z);
1005 z++;
1006 }
@@ -1037,11 +1043,11 @@
1043 }
1044 *d = 0;
1045 @ <blockquote><pre>
1046 @ %h(z)
1047 @ </pre></blockquote>
1048 fossil_free(z);
1049 }
1050 }
1051 }else{
1052 int i, j, n;
1053
@@ -1696,11 +1702,11 @@
1702 while( zPath && zPath[0] ){
1703 while( zPath[0]==':' ) zPath++;
1704 for(i=0; zPath[i] && zPath[i]!=':'; i++){}
1705 zFull = mprintf("%.*s/%s", i, zPath, zBinary);
1706 bExists = file_access(zFull, X_OK);
1707 fossil_free(zFull);
1708 if( bExists==0 ) return 1;
1709 zPath += i;
1710 }
1711 return 0;
1712 }
1713

Keyboard Shortcuts

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