Insure that mlwrite( "") as same effect as mlerase().

This commit is contained in:
Renaud 2015-02-13 15:33:21 +08:00
parent 5e5558e00b
commit 2953531913
4 changed files with 9 additions and 9 deletions

View File

@ -135,7 +135,7 @@ bindable.o: bindable.c bindable.h defines.h buffer.h crypt.h line.h \
retcode.h utf8.h display.h estruct.h file.h input.h bind.h lock.h \
mlout.h terminal.h
buffer.o: buffer.c buffer.h crypt.h line.h retcode.h utf8.h defines.h \
display.h estruct.h file.h input.h bind.h window.h
estruct.h file.h input.h bind.h mlout.h window.h
crypt.o: crypt.c crypt.h
display.o: display.c display.h estruct.h buffer.h crypt.h line.h \
retcode.h utf8.h input.h bind.h termio.h terminal.h defines.h version.h \
@ -164,8 +164,8 @@ line.o: line.c line.h retcode.h utf8.h buffer.h crypt.h estruct.h mlout.h \
window.h defines.h
lock.o: lock.c estruct.h lock.h
main.o: main.c estruct.h basic.h bind.h bindable.h buffer.h crypt.h \
line.h retcode.h utf8.h display.h eval.h execute.h file.h input.h \
mlout.h lock.h random.h search.h terminal.h defines.h termio.h version.h \
line.h retcode.h utf8.h display.h eval.h execute.h file.h input.h lock.h \
mlout.h random.h search.h terminal.h defines.h termio.h version.h \
window.h
mingw32.o: mingw32.c
mlout.o: mlout.c mlout.h

View File

@ -17,10 +17,10 @@
#include <string.h>
#include "defines.h"
#include "display.h"
#include "estruct.h"
#include "file.h"
#include "input.h"
#include "mlout.h"
#include "window.h"
@ -189,7 +189,7 @@ int zotbuf(struct buffer *bp)
int s;
if (bp->b_nwnd != 0) { /* Error if on screen. */
mlwrite("Buffer is being displayed");
mloutstr("Buffer is being displayed");
return FALSE;
}
if ((s = bclear(bp)) != TRUE) /* Blow text away. */
@ -238,7 +238,7 @@ int namebuffer(int f, int n)
strcpy(curbp->b_bname, bufn); /* copy buffer name to structure */
curwp->w_flag |= WFMODE; /* make mode line replot */
mlerase();
mloutstr( "") ; /* erase message line */
return TRUE;
}

View File

@ -1370,6 +1370,7 @@ void mlwrite(const char *fmt, ...)
else
movecursor( term.t_nrow, 0) ;
mpresf = *fmt ? TRUE : FALSE ; /* flag if line has content or not */
va_start(ap, fmt);
while ((c = *fmt++) != 0) {
if (c != '%')
@ -1417,7 +1418,6 @@ void mlwrite(const char *fmt, ...)
TTeeol() ;
TTflush();
mpresf = TRUE;
}
/*
@ -1432,7 +1432,7 @@ void mlforce( char *s) {
oldcmd = discmd; /* save the discmd value */
discmd = TRUE; /* and turn display on */
mlwrite( "%s", s) ; /* write the string out */
mlwrite( (*s) ? "%s" : "", s) ; /* write the string out or erase line */
discmd = oldcmd; /* and restore the original setting */
}

View File

@ -9,7 +9,7 @@ static void mloutdump( const char *buf, ...) {
void (*mloutfmt)( const char *, ...) = mloutdump ;
void mloutstr( const char *str) {
mloutfmt( "%s", str) ;
mloutfmt( (*str) ? "%s" : "", str) ;
}
/* end of mlout.c */