summaryrefslogtreecommitdiff
path: root/src/fe-text/term-terminfo.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-12-04 14:40:37 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-12-04 14:40:37 +0000
commit377b66745dade5fb1bb6ca5bfe3ba95ef74966e9 (patch)
treedb9db9ebe6637cfefa570f1775a7d3f7a022987d /src/fe-text/term-terminfo.c
parent575a5a3b8b69fba6a92666509a89a3e684668793 (diff)
downloadirssi-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/fe-text/term-terminfo.c')
-rw-r--r--src/fe-text/term-terminfo.c16
1 files changed, 12 insertions, 4 deletions
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)