diff options
author | Timo Sirainen <cras@irssi.org> | 2001-12-04 14:40:37 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-12-04 14:40:37 +0000 |
commit | 377b66745dade5fb1bb6ca5bfe3ba95ef74966e9 (patch) | |
tree | db9db9ebe6637cfefa570f1775a7d3f7a022987d /src | |
parent | 575a5a3b8b69fba6a92666509a89a3e684668793 (diff) | |
download | irssi-377b66745dade5fb1bb6ca5bfe3ba95ef74966e9.zip |
Never print the last character in screen, this may break some terminals (cygwin at least).
term_addstr() now uses const char * instead of char * parameter.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2192 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-text/term-curses.c | 4 | ||||
-rw-r--r-- | src/fe-text/term-terminfo.c | 16 | ||||
-rw-r--r-- | src/fe-text/term.h | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/src/fe-text/term-curses.c b/src/fe-text/term-curses.c index 6f71ac29..69e2b922 100644 --- a/src/fe-text/term-curses.c +++ b/src/fe-text/term-curses.c @@ -314,9 +314,9 @@ void term_addch(TERM_WINDOW *window, int chr) waddch(window->win, chr); } -void term_addstr(TERM_WINDOW *window, char *str) +void term_addstr(TERM_WINDOW *window, const char *str) { - waddstr(window->win, str); + waddstr(window->win, (const char *) str); } void term_clrtoeol(TERM_WINDOW *window) diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c index 8ed62ced..039a520b 100644 --- a/src/fe-text/term-terminfo.c +++ b/src/fe-text/term-terminfo.c @@ -344,15 +344,23 @@ static void term_printed_text(int count) void term_addch(TERM_WINDOW *window, int chr) { if (vcmove) term_move_real(); - putc(chr, window->term->out); term_printed_text(1); + if (vcy != term_height || vcx != 0) + putc(chr, window->term->out); } -void term_addstr(TERM_WINDOW *window, char *str) +void term_addstr(TERM_WINDOW *window, const char *str) { + int len; + if (vcmove) term_move_real(); - fputs(str, window->term->out); - term_printed_text(strlen(str)); + len = strlen(str); + term_printed_text(len); + + if (vcy != term_height || vcx != 0) + fputs(str, window->term->out); + else + fwrite(str, 1, len-1, window->term->out); } void term_clrtoeol(TERM_WINDOW *window) diff --git a/src/fe-text/term.h b/src/fe-text/term.h index 74e51f31..1e771932 100644 --- a/src/fe-text/term.h +++ b/src/fe-text/term.h @@ -63,7 +63,7 @@ void term_set_color(TERM_WINDOW *window, int col); void term_move(TERM_WINDOW *window, int x, int y); void term_addch(TERM_WINDOW *window, int chr); -void term_addstr(TERM_WINDOW *window, char *str); +void term_addstr(TERM_WINDOW *window, const char *str); void term_clrtoeol(TERM_WINDOW *window); void term_move_cursor(int x, int y); |