summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2007-02-20 12:39:17 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-02-20 12:39:17 +0000
commite9681e4b9ee51e29dbae30f063e177075af550cb (patch)
treeff0adc46ab5de92e0b1f6d3efb70bc8074740a99 /src
parente8f733d5f0d952da1401a9ee72c36634a30d5802 (diff)
downloadirssi-e9681e4b9ee51e29dbae30f063e177075af550cb.zip
UTF-8 0x80-0x9f characters weren't treated as control chars as they should have
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4425 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/textbuffer-view.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c
index 3dca76f3..bffc0e25 100644
--- a/src/fe-text/textbuffer-view.c
+++ b/src/fe-text/textbuffer-view.c
@@ -342,6 +342,7 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
LINE_CACHE_REC *cache;
const unsigned char *text, *end, *text_newline;
unsigned char *tmp;
+ unichar chr;
int xpos, color, drawcount, first, need_move, need_clrtoeol, char_width;
if (view->dirty) /* don't bother drawing anything - redraw is coming */
@@ -432,9 +433,9 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
continue;
}
+ chr = *text;
end = text;
if (view->utf8) {
- unichar chr;
if (get_utf8_char(&end, 6, &chr)<0)
char_width = 1;
else
@@ -450,15 +451,14 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
xpos += char_width;
if (xpos <= term_width) {
- if (*text >= 32 &&
- (end != text || (*text & 127) >= 32)) {
+ if ((chr & ~0x80) >= 32) {
for (; text < end; text++)
term_addch(view->window, *text);
term_addch(view->window, *text);
} else {
/* low-ascii */
term_set_color(view->window, ATTR_RESET|ATTR_REVERSE);
- term_addch(view->window, (*text & 127)+'A'-1);
+ term_addch(view->window, (chr & 127)+'A'-1);
term_set_color(view->window, color);
}
}