Fossil SCM
Fixed %j encoding to backslash-escape double-quotes. It was accounting for them in its allocation but not actually escaping them.
Commit
caa51decb85c1f888e329cd1c6f207b3c14787e18c75523e16d637cd4ba2b74a
Parent
b82cb2751460f8d…
1 file changed
+1
-1
+1
-1
| --- src/encode.c | ||
| +++ src/encode.c | ||
| @@ -419,11 +419,11 @@ | ||
| 419 | 419 | i = 0; |
| 420 | 420 | if(fAddQuotes){ |
| 421 | 421 | zOut[i++] = '"'; |
| 422 | 422 | } |
| 423 | 423 | while( (c = fossil_utf8_read(&z))!=0 ){ |
| 424 | - if( c=='\\' ){ | |
| 424 | + if( c=='\\' || c=='"' ){ | |
| 425 | 425 | zOut[i++] = '\\'; |
| 426 | 426 | zOut[i++] = c; |
| 427 | 427 | }else if( c<' ' || c>=0x7f ){ |
| 428 | 428 | zOut[i++] = '\\'; |
| 429 | 429 | if( c=='\n' ){ |
| 430 | 430 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -419,11 +419,11 @@ | |
| 419 | i = 0; |
| 420 | if(fAddQuotes){ |
| 421 | zOut[i++] = '"'; |
| 422 | } |
| 423 | while( (c = fossil_utf8_read(&z))!=0 ){ |
| 424 | if( c=='\\' ){ |
| 425 | zOut[i++] = '\\'; |
| 426 | zOut[i++] = c; |
| 427 | }else if( c<' ' || c>=0x7f ){ |
| 428 | zOut[i++] = '\\'; |
| 429 | if( c=='\n' ){ |
| 430 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -419,11 +419,11 @@ | |
| 419 | i = 0; |
| 420 | if(fAddQuotes){ |
| 421 | zOut[i++] = '"'; |
| 422 | } |
| 423 | while( (c = fossil_utf8_read(&z))!=0 ){ |
| 424 | if( c=='\\' || c=='"' ){ |
| 425 | zOut[i++] = '\\'; |
| 426 | zOut[i++] = c; |
| 427 | }else if( c<' ' || c>=0x7f ){ |
| 428 | zOut[i++] = '\\'; |
| 429 | if( c=='\n' ){ |
| 430 |