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.
Commit
4f510b66cb76c42e804e308f8f29e7de0b332b3f
Parent
886e1bb2a8ed8e1…
1 file changed
+1
-2
+1
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -518,12 +518,11 @@ | ||
| 518 | 518 | if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){ |
| 519 | 519 | /* Unicode character in the range U+E000 - U+F8FF are for |
| 520 | 520 | * private use, they shouldn't occur in filenames. */ |
| 521 | 521 | return 0; |
| 522 | 522 | } |
| 523 | - } | |
| 524 | - if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){ | |
| 523 | + }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){ | |
| 525 | 524 | /* Unicode character in the range U+D800 - U+DFFF are for |
| 526 | 525 | * surrogate pairs, they shouldn't occur in filenames. */ |
| 527 | 526 | return 0; |
| 528 | 527 | } |
| 529 | 528 | } |
| 530 | 529 |
| --- 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 |