Fossil SCM
fossil_warning() is now a no-op in JSON mode, to avoid corrupting the output.
Commit
6ce6b5e63ff041a757db81bd587dec5032bc0769
Parent
c2b1bc686d9d3e7…
1 file changed
+6
+6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -494,10 +494,16 @@ | ||
| 494 | 494 | |
| 495 | 495 | /* Print a warning message */ |
| 496 | 496 | void fossil_warning(const char *zFormat, ...){ |
| 497 | 497 | char *z; |
| 498 | 498 | va_list ap; |
| 499 | + if( g.json.isJsonMode ){ | |
| 500 | + /* The JSON API has no way of dealing with warnings and | |
| 501 | + outputing them here will corrupt the output. | |
| 502 | + */ | |
| 503 | + return; | |
| 504 | + } | |
| 499 | 505 | va_start(ap, zFormat); |
| 500 | 506 | z = vmprintf(zFormat, ap); |
| 501 | 507 | va_end(ap); |
| 502 | 508 | if( g.cgiOutput ){ |
| 503 | 509 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 504 | 510 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -494,10 +494,16 @@ | |
| 494 | |
| 495 | /* Print a warning message */ |
| 496 | void fossil_warning(const char *zFormat, ...){ |
| 497 | char *z; |
| 498 | va_list ap; |
| 499 | va_start(ap, zFormat); |
| 500 | z = vmprintf(zFormat, ap); |
| 501 | va_end(ap); |
| 502 | if( g.cgiOutput ){ |
| 503 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 504 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -494,10 +494,16 @@ | |
| 494 | |
| 495 | /* Print a warning message */ |
| 496 | void fossil_warning(const char *zFormat, ...){ |
| 497 | char *z; |
| 498 | va_list ap; |
| 499 | if( g.json.isJsonMode ){ |
| 500 | /* The JSON API has no way of dealing with warnings and |
| 501 | outputing them here will corrupt the output. |
| 502 | */ |
| 503 | return; |
| 504 | } |
| 505 | va_start(ap, zFormat); |
| 506 | z = vmprintf(zFormat, ap); |
| 507 | va_end(ap); |
| 508 | if( g.cgiOutput ){ |
| 509 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 510 |