From 891f4c3238a4832a1331785011e6156d553af06b Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Wed, 21 Jan 2015 17:16:43 +0800 Subject: [PATCH] Restrict scope of mlputs to display. --- display.c | 4 ++-- display.h | 1 - spawn.c | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/display.c b/display.c index cd93f39..633b148 100644 --- a/display.c +++ b/display.c @@ -87,6 +87,7 @@ static void modeline(struct window *wp); static void mlputi(int i, int r); static void mlputli(long l, int r); static void mlputf(int s); +static void mlputs( char *s) ; #if SIGWINCH static int newscreensize(int h, int w); #endif @@ -1436,8 +1437,7 @@ void mlforce( char *s) { * the characters in the string all have width "1"; if this is not the case * things will get screwed up a little. */ -void mlputs(char *s) -{ +static void mlputs( char *s) { int c; while ((c = *s++) != 0) { diff --git a/display.h b/display.h index 9b47065..26ba4fc 100644 --- a/display.h +++ b/display.h @@ -24,7 +24,6 @@ void movecursor( int row, int col) ; void mlerase( void) ; void mlwrite( const char *fmt, ...) ; void mlforce( char *s) ; -void mlputs( char *s) ; void getscreensize( int *widthp, int *heightp) ; #if UNIX diff --git a/spawn.c b/spawn.c index 172f134..a11f9cd 100644 --- a/spawn.c +++ b/spawn.c @@ -68,12 +68,12 @@ int spawncli(int f, int n) #if VMS movecursor(term.t_nrow, 0); /* In last line. */ - mlputs("(Starting DCL)\r\n"); + mlwrite("(Starting DCL)\r\n"); TTflush(); /* Ignore "ttcol". */ sgarbf = TRUE; sys(NULL); sleep(1); - mlputs("\r\n(Returning from DCL)\r\n"); + mlwrite("\r\n(Returning from DCL)\r\n"); TTflush(); sleep(1); return TRUE; @@ -162,7 +162,7 @@ int spawn(int f, int n) TTflush(); s = sys(line); /* Run the command. */ if (clexec == FALSE) { - mlputs("\r\n\n(End)"); /* Pause. */ + mlwrite("\r\n\n(End)"); /* Pause. */ TTflush(); tgetc(); } @@ -178,7 +178,7 @@ int spawn(int f, int n) TTkopen(); /* if we are interactive, pause here */ if (clexec == FALSE) { - mlputs("\r\n(End)"); + mlwrite("\r\n(End)"); tgetc(); } sgarbf = TRUE; @@ -195,10 +195,10 @@ int spawn(int f, int n) TTopen(); if (clexec == FALSE) { - mlputs("(End)"); /* Pause. */ + mlwrite( "(End)") ; /* Pause. */ TTflush(); while ((s = tgetc()) != '\r' && s != ' '); - mlputs("\r\n"); + mlwrite( "\r\n") ; } TTkopen(); sgarbf = TRUE; @@ -226,7 +226,7 @@ int execprg(int f, int n) return s; TTflush(); s = sys(line); /* Run the command. */ - mlputs("\r\n\n(End)"); /* Pause. */ + mlwrite("\r\n\n(End)"); /* Pause. */ TTflush(); tgetc(); sgarbf = TRUE; @@ -242,7 +242,7 @@ int execprg(int f, int n) TTkopen(); /* if we are interactive, pause here */ if (clexec == FALSE) { - mlputs("\r\n(End)"); + mlwrite("\r\n(End)"); tgetc(); } sgarbf = TRUE; @@ -259,7 +259,7 @@ int execprg(int f, int n) ue_system( line) ; fflush(stdout); /* to be sure P.K. */ TTopen(); - mlputs("(End)"); /* Pause. */ + mlwrite( "(End)") ; /* Pause. */ TTflush(); while ((s = tgetc()) != '\r' && s != ' '); sgarbf = TRUE; @@ -429,7 +429,7 @@ int filter_buffer(int f, int n) /* write it out, checking for errors */ if (writeout(filnam1) != TRUE) { - mlwrite("(Cannot write filter file)"); + mlwrite( "(Cannot write filter file)") ; strcpy(bp->b_fname, tmpnam); return FALSE; } @@ -459,7 +459,7 @@ int filter_buffer(int f, int n) /* on failure, escape gracefully */ if (s != TRUE || (readin(filnam2, FALSE) == FALSE)) { - mlwrite("(Execution failed)"); + mlwrite( "(Execution failed)") ; strcpy(bp->b_fname, tmpnam); unlink(filnam1); unlink(filnam2);