Fossil SCM

one more: if we already know the character is in the range U+E000 - U+FFFF, it cannot be a surrogate any more.

jan.nijtmans 2013-01-15 10:21 trunk
Commit 4f510b66cb76c42e804e308f8f29e7de0b332b3f
1 file changed +1 -2
+1 -2
--- src/file.c
+++ src/file.c
@@ -518,12 +518,11 @@
518518
if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){
519519
/* Unicode character in the range U+E000 - U+F8FF are for
520520
* private use, they shouldn't occur in filenames. */
521521
return 0;
522522
}
523
- }
524
- if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
523
+ }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
525524
/* Unicode character in the range U+D800 - U+DFFF are for
526525
* surrogate pairs, they shouldn't occur in filenames. */
527526
return 0;
528527
}
529528
}
530529
--- src/file.c
+++ src/file.c
@@ -518,12 +518,11 @@
518 if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){
519 /* Unicode character in the range U+E000 - U+F8FF are for
520 * private use, they shouldn't occur in filenames. */
521 return 0;
522 }
523 }
524 if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
525 /* Unicode character in the range U+D800 - U+DFFF are for
526 * surrogate pairs, they shouldn't occur in filenames. */
527 return 0;
528 }
529 }
530
--- src/file.c
+++ src/file.c
@@ -518,12 +518,11 @@
518 if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){
519 /* Unicode character in the range U+E000 - U+F8FF are for
520 * private use, they shouldn't occur in filenames. */
521 return 0;
522 }
523 }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
 
524 /* Unicode character in the range U+D800 - U+DFFF are for
525 * surrogate pairs, they shouldn't occur in filenames. */
526 return 0;
527 }
528 }
529

Keyboard Shortcuts

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