Skip to content

Commit 739038d

Browse files
author
ripley
committed
tweak to zero-width tables
git-svn-id: https://svn.r-project.org/R/trunk@80276 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent b38d002 commit 739038d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/rlocale.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ static int wcwidthsearch(int wint, const struct interval_wcwidth *table,
128128
int mid;
129129
max--;
130130

131-
/* This quickly gives one for ASCII characters since the table
132-
starts at 0xa1 */
133-
if (wint < table[0].first || wint > table[max].last) return 1;
131+
/* This quickly gives one for printing ASCII characters */
132+
if (wint > 0x1F && wint < 0x7F) return 1;
133+
else if (wint < table[min].first || wint > table[max].last) return -1;
134134
while (max >= min) {
135135
mid = (min + max) / 2;
136136
if (wint > table[mid].last)

0 commit comments

Comments
 (0)