Fix getccol reporting when dealing with characters in range 0x80 .. 0xA0.

This commit is contained in:
Renaud 2015-02-09 13:31:39 +08:00
parent 135238106c
commit 3f1ac2596c
1 changed files with 3 additions and 3 deletions

View File

@ -173,13 +173,13 @@ int getccol(int bflg)
unicode_t c;
i += utf8_to_unicode(dlp->l_text, i, len, &c);
if (c != ' ' && c != '\t' && bflg)
if( bflg && c != ' ' && c != '\t') /* Request Stop at first non-blank */
break;
if (c == '\t')
col |= tabmask;
else if (c < 0x20 || c == 0x7F)
else if (c < 0x20 || c == 0x7F) /* displayed as ^c */
++col;
else if (c >= 0xc0 && c <= 0xa0)
else if (c >= 0x80 && c <= 0xa0) /* displayed as \xx */
col += 2;
++col;
}