Fossil SCM

slight change to the assertions in the latin1 workaround. Nothing functional.

stephan 2013-09-06 18:17 trunk
Commit c66ee0d66737ff61ea4c643bc4844f73d13967bd
1 file changed +4 -4
--- src/cson_amalgamation.c
+++ src/cson_amalgamation.c
@@ -3800,25 +3800,25 @@
38003800
/* Workaround for fossil repo artifact
38013801
f460839cff85d4e4f1360b366bb2858cef1411ea,
38023802
which has what appears to be latin1-encoded
38033803
text. file(1) thinks it's a FORTRAN program.
38043804
*/
3805
- if((*pos != ch) && (0xfffd==ch)){
3805
+ if(0xfffd==ch){
3806
+ assert(*pos != ch);
3807
+ /* MARKER("ch=%04x, *pos=%04x\n", ch, *pos); */
38063808
ch = *pos
38073809
/* We should arguably translate to '?', and
38083810
will if this problem ever comes up with a
38093811
non-latin1 encoding. For latin1 this
38103812
workaround incidentally corrects the output
38113813
to proper UTF8-escaped characters, and only
38123814
for that reason is it being kept around.
38133815
*/;
3814
- /* MARKER("ch=%04x, *pos=%04x\n", ch, *pos); */
38153816
goto assume_latin1;
38163817
}
3817
-#else
3818
- assert( *pos == ch );
38193818
#endif
3819
+ assert( (*pos == ch) && "Invalid UTF8" );
38203820
escChar[1] = 0;
38213821
switch(ch)
38223822
{
38233823
case '\t': escChar[1] = 't'; break;
38243824
case '\r': escChar[1] = 'r'; break;
38253825
--- 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

Keyboard Shortcuts

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