mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
clear to end of line when printing error messages so that previous
messages don't remain and pollute the line
This commit is contained in:
parent
2ddfbac012
commit
65b0e16c1a
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: getguess.c,v 1.9 2009/10/27 23:59:25 deraadt Exp $ */
|
||||
/* $OpenBSD: getguess.c,v 1.10 2015/02/07 01:43:51 tedu Exp $ */
|
||||
/* $NetBSD: getguess.c,v 1.5 1995/03/23 08:32:43 cgd Exp $ */
|
||||
|
||||
/*
|
||||
@ -52,17 +52,22 @@ getguess(void)
|
||||
if (isalpha(ch)) {
|
||||
if (isupper(ch))
|
||||
ch = tolower(ch);
|
||||
if (Guessed[ch - 'a'])
|
||||
if (Guessed[ch - 'a']) {
|
||||
move(MESGY, MESGX);
|
||||
clrtoeol();
|
||||
mvprintw(MESGY, MESGX, "Already guessed '%c'",
|
||||
ch);
|
||||
else
|
||||
} else
|
||||
break;
|
||||
} else
|
||||
if (ch == CTRL('D'))
|
||||
die(0);
|
||||
else
|
||||
else {
|
||||
move(MESGY, MESGX);
|
||||
clrtoeol();
|
||||
mvprintw(MESGY, MESGX,
|
||||
"Not a valid guess: '%s'", unctrl(ch));
|
||||
}
|
||||
}
|
||||
leaveok(stdscr, TRUE);
|
||||
move(MESGY, MESGX);
|
||||
|
Loading…
Reference in New Issue
Block a user