Fossil SCM
slight change to the assertions in the latin1 workaround. Nothing functional.
Commit
c66ee0d66737ff61ea4c643bc4844f73d13967bd
Parent
339f9f324fca2cf…
1 file changed
+4
-4
+4
-4
| --- src/cson_amalgamation.c | ||
| +++ src/cson_amalgamation.c | ||
| @@ -3800,25 +3800,25 @@ | ||
| 3800 | 3800 | /* Workaround for fossil repo artifact |
| 3801 | 3801 | f460839cff85d4e4f1360b366bb2858cef1411ea, |
| 3802 | 3802 | which has what appears to be latin1-encoded |
| 3803 | 3803 | text. file(1) thinks it's a FORTRAN program. |
| 3804 | 3804 | */ |
| 3805 | - if((*pos != ch) && (0xfffd==ch)){ | |
| 3805 | + if(0xfffd==ch){ | |
| 3806 | + assert(*pos != ch); | |
| 3807 | + /* MARKER("ch=%04x, *pos=%04x\n", ch, *pos); */ | |
| 3806 | 3808 | ch = *pos |
| 3807 | 3809 | /* We should arguably translate to '?', and |
| 3808 | 3810 | will if this problem ever comes up with a |
| 3809 | 3811 | non-latin1 encoding. For latin1 this |
| 3810 | 3812 | workaround incidentally corrects the output |
| 3811 | 3813 | to proper UTF8-escaped characters, and only |
| 3812 | 3814 | for that reason is it being kept around. |
| 3813 | 3815 | */; |
| 3814 | - /* MARKER("ch=%04x, *pos=%04x\n", ch, *pos); */ | |
| 3815 | 3816 | goto assume_latin1; |
| 3816 | 3817 | } |
| 3817 | -#else | |
| 3818 | - assert( *pos == ch ); | |
| 3819 | 3818 | #endif |
| 3819 | + assert( (*pos == ch) && "Invalid UTF8" ); | |
| 3820 | 3820 | escChar[1] = 0; |
| 3821 | 3821 | switch(ch) |
| 3822 | 3822 | { |
| 3823 | 3823 | case '\t': escChar[1] = 't'; break; |
| 3824 | 3824 | case '\r': escChar[1] = 'r'; break; |
| 3825 | 3825 |
| --- src/cson_amalgamation.c | |
| +++ src/cson_amalgamation.c | |
| @@ -3800,25 +3800,25 @@ | |
| 3800 | /* Workaround for fossil repo artifact |
| 3801 | f460839cff85d4e4f1360b366bb2858cef1411ea, |
| 3802 | which has what appears to be latin1-encoded |
| 3803 | text. file(1) thinks it's a FORTRAN program. |
| 3804 | */ |
| 3805 | if((*pos != ch) && (0xfffd==ch)){ |
| 3806 | ch = *pos |
| 3807 | /* We should arguably translate to '?', and |
| 3808 | will if this problem ever comes up with a |
| 3809 | non-latin1 encoding. For latin1 this |
| 3810 | workaround incidentally corrects the output |
| 3811 | to proper UTF8-escaped characters, and only |
| 3812 | for that reason is it being kept around. |
| 3813 | */; |
| 3814 | /* MARKER("ch=%04x, *pos=%04x\n", ch, *pos); */ |
| 3815 | goto assume_latin1; |
| 3816 | } |
| 3817 | #else |
| 3818 | assert( *pos == ch ); |
| 3819 | #endif |
| 3820 | escChar[1] = 0; |
| 3821 | switch(ch) |
| 3822 | { |
| 3823 | case '\t': escChar[1] = 't'; break; |
| 3824 | case '\r': escChar[1] = 'r'; break; |
| 3825 |
| --- src/cson_amalgamation.c | |
| +++ src/cson_amalgamation.c | |
| @@ -3800,25 +3800,25 @@ | |
| 3800 | /* Workaround for fossil repo artifact |
| 3801 | f460839cff85d4e4f1360b366bb2858cef1411ea, |
| 3802 | which has what appears to be latin1-encoded |
| 3803 | text. file(1) thinks it's a FORTRAN program. |
| 3804 | */ |
| 3805 | if(0xfffd==ch){ |
| 3806 | assert(*pos != ch); |
| 3807 | /* MARKER("ch=%04x, *pos=%04x\n", ch, *pos); */ |
| 3808 | ch = *pos |
| 3809 | /* We should arguably translate to '?', and |
| 3810 | will if this problem ever comes up with a |
| 3811 | non-latin1 encoding. For latin1 this |
| 3812 | workaround incidentally corrects the output |
| 3813 | to proper UTF8-escaped characters, and only |
| 3814 | for that reason is it being kept around. |
| 3815 | */; |
| 3816 | goto assume_latin1; |
| 3817 | } |
| 3818 | #endif |
| 3819 | assert( (*pos == ch) && "Invalid UTF8" ); |
| 3820 | escChar[1] = 0; |
| 3821 | switch(ch) |
| 3822 | { |
| 3823 | case '\t': escChar[1] = 't'; break; |
| 3824 | case '\r': escChar[1] = 'r'; break; |
| 3825 |