Fossil SCM

Fixed %j encoding to backslash-escape double-quotes. It was accounting for them in its allocation but not actually escaping them.

stephan 2020-07-29 20:08 trunk
Commit caa51decb85c1f888e329cd1c6f207b3c14787e18c75523e16d637cd4ba2b74a
1 file changed +1 -1
+1 -1
--- src/encode.c
+++ src/encode.c
@@ -419,11 +419,11 @@
419419
i = 0;
420420
if(fAddQuotes){
421421
zOut[i++] = '"';
422422
}
423423
while( (c = fossil_utf8_read(&z))!=0 ){
424
- if( c=='\\' ){
424
+ if( c=='\\' || c=='"' ){
425425
zOut[i++] = '\\';
426426
zOut[i++] = c;
427427
}else if( c<' ' || c>=0x7f ){
428428
zOut[i++] = '\\';
429429
if( c=='\n' ){
430430
--- 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

Keyboard Shortcuts

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