Fossil SCM
Fix the unicode code-point width estimating function to align with the SQLite CLI.
Commit
e483b3b15fad08e6dc03fe1d7f304d6cee69db48539dd3a2912561813ae9b8d4
Parent
83743188a37564c…
1 file changed
+1
-4
+1
-4
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | */ |
| 40 | 40 | static const struct { |
| 41 | 41 | unsigned char w; /* Width of the character in columns */ |
| 42 | 42 | int iFirst; /* First character in a span having this width */ |
| 43 | 43 | } aUWidth[] = { |
| 44 | - /* {0, 0x00000}, {1, 0x00020}, {0, 0x0007f}, {1, 0x000a0}, */ | |
| 44 | + /* {1, 0x00000}, */ | |
| 45 | 45 | {0, 0x00300}, {1, 0x00370}, {0, 0x00483}, {1, 0x00487}, {0, 0x00488}, |
| 46 | 46 | {1, 0x0048a}, {0, 0x00591}, {1, 0x005be}, {0, 0x005bf}, {1, 0x005c0}, |
| 47 | 47 | {0, 0x005c1}, {1, 0x005c3}, {0, 0x005c4}, {1, 0x005c6}, {0, 0x005c7}, |
| 48 | 48 | {1, 0x005c8}, {0, 0x00600}, {1, 0x00604}, {0, 0x00610}, {1, 0x00616}, |
| 49 | 49 | {0, 0x0064b}, {1, 0x0065f}, {0, 0x00670}, {1, 0x00671}, {0, 0x006d6}, |
| @@ -117,13 +117,10 @@ | ||
| 117 | 117 | */ |
| 118 | 118 | static int cli_wcwidth(int c){ |
| 119 | 119 | int iFirst, iLast; |
| 120 | 120 | |
| 121 | 121 | /* Fast path for common characters */ |
| 122 | - if( c<0x20 ) return 0; | |
| 123 | - if( c<0x7f ) return 1; | |
| 124 | - if( c<0xa0 ) return 0; | |
| 125 | 122 | if( c<=0x300 ) return 1; |
| 126 | 123 | |
| 127 | 124 | /* The general case */ |
| 128 | 125 | iFirst = 0; |
| 129 | 126 | iLast = sizeof(aUWidth)/sizeof(aUWidth[0]) - 1; |
| 130 | 127 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | */ |
| 40 | static const struct { |
| 41 | unsigned char w; /* Width of the character in columns */ |
| 42 | int iFirst; /* First character in a span having this width */ |
| 43 | } aUWidth[] = { |
| 44 | /* {0, 0x00000}, {1, 0x00020}, {0, 0x0007f}, {1, 0x000a0}, */ |
| 45 | {0, 0x00300}, {1, 0x00370}, {0, 0x00483}, {1, 0x00487}, {0, 0x00488}, |
| 46 | {1, 0x0048a}, {0, 0x00591}, {1, 0x005be}, {0, 0x005bf}, {1, 0x005c0}, |
| 47 | {0, 0x005c1}, {1, 0x005c3}, {0, 0x005c4}, {1, 0x005c6}, {0, 0x005c7}, |
| 48 | {1, 0x005c8}, {0, 0x00600}, {1, 0x00604}, {0, 0x00610}, {1, 0x00616}, |
| 49 | {0, 0x0064b}, {1, 0x0065f}, {0, 0x00670}, {1, 0x00671}, {0, 0x006d6}, |
| @@ -117,13 +117,10 @@ | |
| 117 | */ |
| 118 | static int cli_wcwidth(int c){ |
| 119 | int iFirst, iLast; |
| 120 | |
| 121 | /* Fast path for common characters */ |
| 122 | if( c<0x20 ) return 0; |
| 123 | if( c<0x7f ) return 1; |
| 124 | if( c<0xa0 ) return 0; |
| 125 | if( c<=0x300 ) return 1; |
| 126 | |
| 127 | /* The general case */ |
| 128 | iFirst = 0; |
| 129 | iLast = sizeof(aUWidth)/sizeof(aUWidth[0]) - 1; |
| 130 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | */ |
| 40 | static const struct { |
| 41 | unsigned char w; /* Width of the character in columns */ |
| 42 | int iFirst; /* First character in a span having this width */ |
| 43 | } aUWidth[] = { |
| 44 | /* {1, 0x00000}, */ |
| 45 | {0, 0x00300}, {1, 0x00370}, {0, 0x00483}, {1, 0x00487}, {0, 0x00488}, |
| 46 | {1, 0x0048a}, {0, 0x00591}, {1, 0x005be}, {0, 0x005bf}, {1, 0x005c0}, |
| 47 | {0, 0x005c1}, {1, 0x005c3}, {0, 0x005c4}, {1, 0x005c6}, {0, 0x005c7}, |
| 48 | {1, 0x005c8}, {0, 0x00600}, {1, 0x00604}, {0, 0x00610}, {1, 0x00616}, |
| 49 | {0, 0x0064b}, {1, 0x0065f}, {0, 0x00670}, {1, 0x00671}, {0, 0x006d6}, |
| @@ -117,13 +117,10 @@ | |
| 117 | */ |
| 118 | static int cli_wcwidth(int c){ |
| 119 | int iFirst, iLast; |
| 120 | |
| 121 | /* Fast path for common characters */ |
| 122 | if( c<=0x300 ) return 1; |
| 123 | |
| 124 | /* The general case */ |
| 125 | iFirst = 0; |
| 126 | iLast = sizeof(aUWidth)/sizeof(aUWidth[0]) - 1; |
| 127 |