Fossil SCM

Fix JSON assert in fossil_print_error() seen when an invalid repository is specified.

mistachkin 2021-03-18 23:31 th1-malloc-debugging
Commit 44cf2e91906e34faa429305a91908cd455b51aee1d39bb602f174fb7cefb6afc
1 file changed +2 -2
+2 -2
--- src/printf.c
+++ src/printf.c
@@ -1100,11 +1100,11 @@
11001100
/*
11011101
** Avoid calling into the JSON support subsystem if it
11021102
** has not yet been initialized, e.g. early SQLite log
11031103
** messages, etc.
11041104
*/
1105
- assert(json_is_bootstrapped_early());
1105
+ if( !json_is_bootstrapped_early() ) json_bootstrap_early();
11061106
json_err( 0, z, 1 );
11071107
if( g.isHTTP && !g.json.preserveRc ){
11081108
rc = 0 /* avoid HTTP 500 */;
11091109
}
11101110
if( g.cgiOutput==1 ){
@@ -1230,11 +1230,11 @@
12301230
/*
12311231
** Avoid calling into the JSON support subsystem if it
12321232
** has not yet been initialized, e.g. early SQLite log
12331233
** messages, etc.
12341234
*/
1235
- assert(json_is_bootstrapped_early());
1235
+ if( !json_is_bootstrapped_early() ) json_bootstrap_early();
12361236
json_warn( FSL_JSON_W_UNKNOWN, "%s", z );
12371237
}else
12381238
#endif
12391239
{
12401240
if( g.cgiOutput==1 ){
12411241
--- src/printf.c
+++ src/printf.c
@@ -1100,11 +1100,11 @@
1100 /*
1101 ** Avoid calling into the JSON support subsystem if it
1102 ** has not yet been initialized, e.g. early SQLite log
1103 ** messages, etc.
1104 */
1105 assert(json_is_bootstrapped_early());
1106 json_err( 0, z, 1 );
1107 if( g.isHTTP && !g.json.preserveRc ){
1108 rc = 0 /* avoid HTTP 500 */;
1109 }
1110 if( g.cgiOutput==1 ){
@@ -1230,11 +1230,11 @@
1230 /*
1231 ** Avoid calling into the JSON support subsystem if it
1232 ** has not yet been initialized, e.g. early SQLite log
1233 ** messages, etc.
1234 */
1235 assert(json_is_bootstrapped_early());
1236 json_warn( FSL_JSON_W_UNKNOWN, "%s", z );
1237 }else
1238 #endif
1239 {
1240 if( g.cgiOutput==1 ){
1241
--- src/printf.c
+++ src/printf.c
@@ -1100,11 +1100,11 @@
1100 /*
1101 ** Avoid calling into the JSON support subsystem if it
1102 ** has not yet been initialized, e.g. early SQLite log
1103 ** messages, etc.
1104 */
1105 if( !json_is_bootstrapped_early() ) json_bootstrap_early();
1106 json_err( 0, z, 1 );
1107 if( g.isHTTP && !g.json.preserveRc ){
1108 rc = 0 /* avoid HTTP 500 */;
1109 }
1110 if( g.cgiOutput==1 ){
@@ -1230,11 +1230,11 @@
1230 /*
1231 ** Avoid calling into the JSON support subsystem if it
1232 ** has not yet been initialized, e.g. early SQLite log
1233 ** messages, etc.
1234 */
1235 if( !json_is_bootstrapped_early() ) json_bootstrap_early();
1236 json_warn( FSL_JSON_W_UNKNOWN, "%s", z );
1237 }else
1238 #endif
1239 {
1240 if( g.cgiOutput==1 ){
1241

Keyboard Shortcuts

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