Fossil SCM
merge trunk
Commit
2050646c9f2fec763c019e809e6a0b33577d6727
Parent
56f6e9f3b9b5c7e…
10 files changed
+1
-1
+1
-1
+1
-1
+1
-1
+3
-1
+3
-1
+3
-3
+3
-3
+21
-15
+21
-15
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -165,11 +165,11 @@ | ||
| 165 | 165 | "\n" |
| 166 | 166 | "Note: the local check-out has not been updated to the new\n" |
| 167 | 167 | " branch. To begin working on the new branch, do this:\n" |
| 168 | 168 | "\n" |
| 169 | 169 | " %s update %s\n", |
| 170 | - fossil_nameofexe(), zBranch | |
| 170 | + g.argv[0], zBranch | |
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | /* Commit */ |
| 176 | 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 | 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 @@ | ||
| 165 | 165 | "\n" |
| 166 | 166 | "Note: the local check-out has not been updated to the new\n" |
| 167 | 167 | " branch. To begin working on the new branch, do this:\n" |
| 168 | 168 | "\n" |
| 169 | 169 | " %s update %s\n", |
| 170 | - fossil_nameofexe(), zBranch | |
| 170 | + g.argv[0], zBranch | |
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | /* Commit */ |
| 176 | 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 | 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 @@ | ||
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | db_end_transaction(0); |
| 916 | 916 | fossil_print("Configuration reset to factory defaults.\n"); |
| 917 | 917 | 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); | |
| 919 | 919 | }else |
| 920 | 920 | { |
| 921 | 921 | fossil_fatal("METHOD should be one of:" |
| 922 | 922 | " export import merge pull push reset"); |
| 923 | 923 | } |
| 924 | 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 | 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 @@ | ||
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | db_end_transaction(0); |
| 916 | 916 | fossil_print("Configuration reset to factory defaults.\n"); |
| 917 | 917 | 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); | |
| 919 | 919 | }else |
| 920 | 920 | { |
| 921 | 921 | fossil_fatal("METHOD should be one of:" |
| 922 | 922 | " export import merge pull push reset"); |
| 923 | 923 | } |
| 924 | 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 | 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 |
M
src/db.c
+3
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -92,11 +92,13 @@ | ||
| 92 | 92 | g.cgiOutput = 0; |
| 93 | 93 | cgi_printf("<h1>Database Error</h1>\n" |
| 94 | 94 | "<pre>%h</pre><p>%s</p>", z, zRebuildMsg); |
| 95 | 95 | cgi_reply(); |
| 96 | 96 | }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); | |
| 98 | 100 | } |
| 99 | 101 | free(z); |
| 100 | 102 | db_force_rollback(); |
| 101 | 103 | fossil_exit(rc); |
| 102 | 104 | } |
| 103 | 105 |
| --- 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 |
M
src/db.c
+3
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -92,11 +92,13 @@ | ||
| 92 | 92 | g.cgiOutput = 0; |
| 93 | 93 | cgi_printf("<h1>Database Error</h1>\n" |
| 94 | 94 | "<pre>%h</pre><p>%s</p>", z, zRebuildMsg); |
| 95 | 95 | cgi_reply(); |
| 96 | 96 | }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); | |
| 98 | 100 | } |
| 99 | 101 | free(z); |
| 100 | 102 | db_force_rollback(); |
| 101 | 103 | fossil_exit(rc); |
| 102 | 104 | } |
| 103 | 105 |
| --- 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 @@ | ||
| 348 | 348 | if( 0 != rc ){ |
| 349 | 349 | cson_value_free( v ); |
| 350 | 350 | } |
| 351 | 351 | assert( (0==rc) && "Adding item to GC failed." ); |
| 352 | 352 | if(0!=rc){ |
| 353 | - fprintf(stderr,"%s: FATAL: alloc error.\n", fossil_nameofexe()) | |
| 353 | + fprintf(stderr,"%s: FATAL: alloc error.\n", g.argv[0]) | |
| 354 | 354 | /* reminder: allocation error is the only reasonable cause of |
| 355 | 355 | error here, provided g.json.gc.a and v are not NULL. |
| 356 | 356 | */ |
| 357 | 357 | ; |
| 358 | 358 | fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere |
| @@ -1104,11 +1104,11 @@ | ||
| 1104 | 1104 | if(!jfile || !*jfile){ |
| 1105 | 1105 | break; |
| 1106 | 1106 | } |
| 1107 | 1107 | inFile = (0==strcmp("-",jfile)) |
| 1108 | 1108 | ? stdin |
| 1109 | - : fossil_fopen(jfile,"rb"); | |
| 1109 | + : fopen(jfile,"rb"); | |
| 1110 | 1110 | if(!inFile){ |
| 1111 | 1111 | g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED; |
| 1112 | 1112 | fossil_fatal("Could not open JSON file [%s].",jfile) |
| 1113 | 1113 | /* Does not return. */ |
| 1114 | 1114 | ; |
| @@ -1628,11 +1628,11 @@ | ||
| 1628 | 1628 | if(!resp){ |
| 1629 | 1629 | /* about the only error case here is out-of-memory. DO NOT |
| 1630 | 1630 | call fossil_panic() here because that calls this function. |
| 1631 | 1631 | */ |
| 1632 | 1632 | fprintf(stderr, "%s: Fatal error: could not allocate " |
| 1633 | - "response object.\n", fossil_nameofexe()); | |
| 1633 | + "response object.\n", g.argv[0]); | |
| 1634 | 1634 | fossil_exit(1); |
| 1635 | 1635 | } |
| 1636 | 1636 | if( g.isHTTP ){ |
| 1637 | 1637 | if(alsoOutput){ |
| 1638 | 1638 | json_send_response(resp); |
| 1639 | 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", 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 @@ | ||
| 348 | 348 | if( 0 != rc ){ |
| 349 | 349 | cson_value_free( v ); |
| 350 | 350 | } |
| 351 | 351 | assert( (0==rc) && "Adding item to GC failed." ); |
| 352 | 352 | if(0!=rc){ |
| 353 | - fprintf(stderr,"%s: FATAL: alloc error.\n", fossil_nameofexe()) | |
| 353 | + fprintf(stderr,"%s: FATAL: alloc error.\n", g.argv[0]) | |
| 354 | 354 | /* reminder: allocation error is the only reasonable cause of |
| 355 | 355 | error here, provided g.json.gc.a and v are not NULL. |
| 356 | 356 | */ |
| 357 | 357 | ; |
| 358 | 358 | fossil_exit(1)/*not fossil_panic() b/c it might land us somewhere |
| @@ -1104,11 +1104,11 @@ | ||
| 1104 | 1104 | if(!jfile || !*jfile){ |
| 1105 | 1105 | break; |
| 1106 | 1106 | } |
| 1107 | 1107 | inFile = (0==strcmp("-",jfile)) |
| 1108 | 1108 | ? stdin |
| 1109 | - : fossil_fopen(jfile,"rb"); | |
| 1109 | + : fopen(jfile,"rb"); | |
| 1110 | 1110 | if(!inFile){ |
| 1111 | 1111 | g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED; |
| 1112 | 1112 | fossil_fatal("Could not open JSON file [%s].",jfile) |
| 1113 | 1113 | /* Does not return. */ |
| 1114 | 1114 | ; |
| @@ -1628,11 +1628,11 @@ | ||
| 1628 | 1628 | if(!resp){ |
| 1629 | 1629 | /* about the only error case here is out-of-memory. DO NOT |
| 1630 | 1630 | call fossil_panic() here because that calls this function. |
| 1631 | 1631 | */ |
| 1632 | 1632 | fprintf(stderr, "%s: Fatal error: could not allocate " |
| 1633 | - "response object.\n", fossil_nameofexe()); | |
| 1633 | + "response object.\n", g.argv[0]); | |
| 1634 | 1634 | fossil_exit(1); |
| 1635 | 1635 | } |
| 1636 | 1636 | if( g.isHTTP ){ |
| 1637 | 1637 | if(alsoOutput){ |
| 1638 | 1638 | json_send_response(resp); |
| 1639 | 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", 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 @@ | ||
| 583 | 583 | if( g.cgiOutput && once ){ |
| 584 | 584 | once = 0; |
| 585 | 585 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 586 | 586 | cgi_reply(); |
| 587 | 587 | }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); | |
| 589 | 589 | fossil_puts(zOut, 1); |
| 590 | + fossil_free(zOut); | |
| 590 | 591 | } |
| 591 | 592 | } |
| 592 | 593 | free(z); |
| 593 | 594 | db_force_rollback(); |
| 594 | 595 | fossil_exit(rc); |
| @@ -615,12 +616,13 @@ | ||
| 615 | 616 | if( g.cgiOutput ){ |
| 616 | 617 | g.cgiOutput = 0; |
| 617 | 618 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 618 | 619 | cgi_reply(); |
| 619 | 620 | }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); | |
| 621 | 622 | fossil_puts(zOut, 1); |
| 623 | + fossil_free(zOut); | |
| 622 | 624 | } |
| 623 | 625 | } |
| 624 | 626 | free(z); |
| 625 | 627 | db_force_rollback(); |
| 626 | 628 | fossil_exit(rc); |
| @@ -656,13 +658,13 @@ | ||
| 656 | 658 | if( g.cgiOutput ){ |
| 657 | 659 | g.cgiOutput = 0; |
| 658 | 660 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 659 | 661 | cgi_reply(); |
| 660 | 662 | }else{ |
| 661 | - char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z); | |
| 663 | + char *zOut = mprintf("\r%s: %s\n", g.argv[0], z); | |
| 662 | 664 | fossil_puts(zOut, 1); |
| 663 | - free(zOut); | |
| 665 | + fossil_free(zOut); | |
| 664 | 666 | } |
| 665 | 667 | } |
| 666 | 668 | db_force_rollback(); |
| 667 | 669 | fossil_exit(rc); |
| 668 | 670 | } |
| @@ -682,13 +684,13 @@ | ||
| 682 | 684 | #endif |
| 683 | 685 | { |
| 684 | 686 | if( g.cgiOutput ){ |
| 685 | 687 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 686 | 688 | }else{ |
| 687 | - char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z); | |
| 689 | + char *zOut = mprintf("\r%s: %s\n", g.argv[0], z); | |
| 688 | 690 | fossil_puts(zOut, 1); |
| 689 | - free(zOut); | |
| 691 | + fossil_free(zOut); | |
| 690 | 692 | } |
| 691 | 693 | } |
| 692 | 694 | free(z); |
| 693 | 695 | } |
| 694 | 696 | |
| @@ -717,14 +719,18 @@ | ||
| 717 | 719 | #if defined(_WIN32) |
| 718 | 720 | /* On windows, we have to put double-quotes around the entire command. |
| 719 | 721 | ** Who knows why - this is just the way windows works. |
| 720 | 722 | */ |
| 721 | 723 | 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); | |
| 726 | 732 | free(zNewCmd); |
| 727 | 733 | #else |
| 728 | 734 | /* On unix, evaluate the command directly. |
| 729 | 735 | */ |
| 730 | 736 | if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd); |
| @@ -790,11 +796,11 @@ | ||
| 790 | 796 | |
| 791 | 797 | /* |
| 792 | 798 | ** Print a usage comment and quit |
| 793 | 799 | */ |
| 794 | 800 | 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); | |
| 796 | 802 | } |
| 797 | 803 | |
| 798 | 804 | /* |
| 799 | 805 | ** Remove n elements from g.argv beginning with the i-th element. |
| 800 | 806 | */ |
| @@ -951,11 +957,11 @@ | ||
| 951 | 957 | */ |
| 952 | 958 | void help_cmd(void){ |
| 953 | 959 | int rc, idx; |
| 954 | 960 | const char *z; |
| 955 | 961 | if( g.argc<3 ){ |
| 956 | - z = fossil_nameofexe(); | |
| 962 | + z = g.argv[0]; | |
| 957 | 963 | fossil_print( |
| 958 | 964 | "Usage: %s help COMMAND\n" |
| 959 | 965 | "Common COMMANDs: (use \"%s help --all\" for a complete list)\n", |
| 960 | 966 | z, z); |
| 961 | 967 | command_list(0, CMDFLAG_1ST_TIER); |
| @@ -990,11 +996,11 @@ | ||
| 990 | 996 | fossil_fatal("no help available for the %s command", |
| 991 | 997 | aCommand[idx].zName); |
| 992 | 998 | } |
| 993 | 999 | while( *z ){ |
| 994 | 1000 | if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){ |
| 995 | - fossil_print("%s", fossil_nameofexe()); | |
| 1001 | + fossil_print("%s", g.argv[0]); | |
| 996 | 1002 | z += 7; |
| 997 | 1003 | }else{ |
| 998 | 1004 | putchar(*z); |
| 999 | 1005 | z++; |
| 1000 | 1006 | } |
| @@ -1037,11 +1043,11 @@ | ||
| 1037 | 1043 | } |
| 1038 | 1044 | *d = 0; |
| 1039 | 1045 | @ <blockquote><pre> |
| 1040 | 1046 | @ %h(z) |
| 1041 | 1047 | @ </pre></blockquote> |
| 1042 | - free(z); | |
| 1048 | + fossil_free(z); | |
| 1043 | 1049 | } |
| 1044 | 1050 | } |
| 1045 | 1051 | }else{ |
| 1046 | 1052 | int i, j, n; |
| 1047 | 1053 | |
| @@ -1696,11 +1702,11 @@ | ||
| 1696 | 1702 | while( zPath && zPath[0] ){ |
| 1697 | 1703 | while( zPath[0]==':' ) zPath++; |
| 1698 | 1704 | for(i=0; zPath[i] && zPath[i]!=':'; i++){} |
| 1699 | 1705 | zFull = mprintf("%.*s/%s", i, zPath, zBinary); |
| 1700 | 1706 | bExists = file_access(zFull, X_OK); |
| 1701 | - free(zFull); | |
| 1707 | + fossil_free(zFull); | |
| 1702 | 1708 | if( bExists==0 ) return 1; |
| 1703 | 1709 | zPath += i; |
| 1704 | 1710 | } |
| 1705 | 1711 | return 0; |
| 1706 | 1712 | } |
| 1707 | 1713 |
| --- 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 @@ | ||
| 583 | 583 | if( g.cgiOutput && once ){ |
| 584 | 584 | once = 0; |
| 585 | 585 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 586 | 586 | cgi_reply(); |
| 587 | 587 | }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); | |
| 589 | 589 | fossil_puts(zOut, 1); |
| 590 | + fossil_free(zOut); | |
| 590 | 591 | } |
| 591 | 592 | } |
| 592 | 593 | free(z); |
| 593 | 594 | db_force_rollback(); |
| 594 | 595 | fossil_exit(rc); |
| @@ -615,12 +616,13 @@ | ||
| 615 | 616 | if( g.cgiOutput ){ |
| 616 | 617 | g.cgiOutput = 0; |
| 617 | 618 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 618 | 619 | cgi_reply(); |
| 619 | 620 | }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); | |
| 621 | 622 | fossil_puts(zOut, 1); |
| 623 | + fossil_free(zOut); | |
| 622 | 624 | } |
| 623 | 625 | } |
| 624 | 626 | free(z); |
| 625 | 627 | db_force_rollback(); |
| 626 | 628 | fossil_exit(rc); |
| @@ -656,13 +658,13 @@ | ||
| 656 | 658 | if( g.cgiOutput ){ |
| 657 | 659 | g.cgiOutput = 0; |
| 658 | 660 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 659 | 661 | cgi_reply(); |
| 660 | 662 | }else{ |
| 661 | - char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z); | |
| 663 | + char *zOut = mprintf("\r%s: %s\n", g.argv[0], z); | |
| 662 | 664 | fossil_puts(zOut, 1); |
| 663 | - free(zOut); | |
| 665 | + fossil_free(zOut); | |
| 664 | 666 | } |
| 665 | 667 | } |
| 666 | 668 | db_force_rollback(); |
| 667 | 669 | fossil_exit(rc); |
| 668 | 670 | } |
| @@ -682,13 +684,13 @@ | ||
| 682 | 684 | #endif |
| 683 | 685 | { |
| 684 | 686 | if( g.cgiOutput ){ |
| 685 | 687 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 686 | 688 | }else{ |
| 687 | - char *zOut = mprintf("\r%s: %s\n", fossil_nameofexe(), z); | |
| 689 | + char *zOut = mprintf("\r%s: %s\n", g.argv[0], z); | |
| 688 | 690 | fossil_puts(zOut, 1); |
| 689 | - free(zOut); | |
| 691 | + fossil_free(zOut); | |
| 690 | 692 | } |
| 691 | 693 | } |
| 692 | 694 | free(z); |
| 693 | 695 | } |
| 694 | 696 | |
| @@ -717,14 +719,18 @@ | ||
| 717 | 719 | #if defined(_WIN32) |
| 718 | 720 | /* On windows, we have to put double-quotes around the entire command. |
| 719 | 721 | ** Who knows why - this is just the way windows works. |
| 720 | 722 | */ |
| 721 | 723 | 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); | |
| 726 | 732 | free(zNewCmd); |
| 727 | 733 | #else |
| 728 | 734 | /* On unix, evaluate the command directly. |
| 729 | 735 | */ |
| 730 | 736 | if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd); |
| @@ -790,11 +796,11 @@ | ||
| 790 | 796 | |
| 791 | 797 | /* |
| 792 | 798 | ** Print a usage comment and quit |
| 793 | 799 | */ |
| 794 | 800 | 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); | |
| 796 | 802 | } |
| 797 | 803 | |
| 798 | 804 | /* |
| 799 | 805 | ** Remove n elements from g.argv beginning with the i-th element. |
| 800 | 806 | */ |
| @@ -951,11 +957,11 @@ | ||
| 951 | 957 | */ |
| 952 | 958 | void help_cmd(void){ |
| 953 | 959 | int rc, idx; |
| 954 | 960 | const char *z; |
| 955 | 961 | if( g.argc<3 ){ |
| 956 | - z = fossil_nameofexe(); | |
| 962 | + z = g.argv[0]; | |
| 957 | 963 | fossil_print( |
| 958 | 964 | "Usage: %s help COMMAND\n" |
| 959 | 965 | "Common COMMANDs: (use \"%s help --all\" for a complete list)\n", |
| 960 | 966 | z, z); |
| 961 | 967 | command_list(0, CMDFLAG_1ST_TIER); |
| @@ -990,11 +996,11 @@ | ||
| 990 | 996 | fossil_fatal("no help available for the %s command", |
| 991 | 997 | aCommand[idx].zName); |
| 992 | 998 | } |
| 993 | 999 | while( *z ){ |
| 994 | 1000 | if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){ |
| 995 | - fossil_print("%s", fossil_nameofexe()); | |
| 1001 | + fossil_print("%s", g.argv[0]); | |
| 996 | 1002 | z += 7; |
| 997 | 1003 | }else{ |
| 998 | 1004 | putchar(*z); |
| 999 | 1005 | z++; |
| 1000 | 1006 | } |
| @@ -1037,11 +1043,11 @@ | ||
| 1037 | 1043 | } |
| 1038 | 1044 | *d = 0; |
| 1039 | 1045 | @ <blockquote><pre> |
| 1040 | 1046 | @ %h(z) |
| 1041 | 1047 | @ </pre></blockquote> |
| 1042 | - free(z); | |
| 1048 | + fossil_free(z); | |
| 1043 | 1049 | } |
| 1044 | 1050 | } |
| 1045 | 1051 | }else{ |
| 1046 | 1052 | int i, j, n; |
| 1047 | 1053 | |
| @@ -1696,11 +1702,11 @@ | ||
| 1696 | 1702 | while( zPath && zPath[0] ){ |
| 1697 | 1703 | while( zPath[0]==':' ) zPath++; |
| 1698 | 1704 | for(i=0; zPath[i] && zPath[i]!=':'; i++){} |
| 1699 | 1705 | zFull = mprintf("%.*s/%s", i, zPath, zBinary); |
| 1700 | 1706 | bExists = file_access(zFull, X_OK); |
| 1701 | - free(zFull); | |
| 1707 | + fossil_free(zFull); | |
| 1702 | 1708 | if( bExists==0 ) return 1; |
| 1703 | 1709 | zPath += i; |
| 1704 | 1710 | } |
| 1705 | 1711 | return 0; |
| 1706 | 1712 | } |
| 1707 | 1713 |
| --- 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 |