mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 21:01:24 +03:00
feedback: treat statusline() being called outside of curses mode as a bug
This commit is contained in:
parent
d656b0d3b9
commit
47770bd321
10
src/winio.c
10
src/winio.c
@ -2211,14 +2211,9 @@ void statusline(message_type importance, const char *msg, ...)
|
|||||||
(lastmessage == MILD && importance == HUSH))
|
(lastmessage == MILD && importance == HUSH))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
va_start(ap, msg);
|
/* Curses mode shouldn't be off when trying to write to the status bar. */
|
||||||
|
|
||||||
/* Curses mode is turned off. If we use wmove() now, it will muck
|
|
||||||
* up the terminal settings. So we just use vfprintf(). */
|
|
||||||
if (isendwin()) {
|
if (isendwin()) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "Out of curses -- please report a bug\n");
|
||||||
vfprintf(stderr, msg, ap);
|
|
||||||
va_end(ap);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2248,6 +2243,7 @@ void statusline(message_type importance, const char *msg, ...)
|
|||||||
|
|
||||||
/* Construct the message out of all the arguments. */
|
/* Construct the message out of all the arguments. */
|
||||||
compound = charalloc(MAXCHARLEN * (COLS + 1));
|
compound = charalloc(MAXCHARLEN * (COLS + 1));
|
||||||
|
va_start(ap, msg);
|
||||||
vsnprintf(compound, MAXCHARLEN * (COLS + 1), msg, ap);
|
vsnprintf(compound, MAXCHARLEN * (COLS + 1), msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
message = display_string(compound, 0, COLS, FALSE, FALSE);
|
message = display_string(compound, 0, COLS, FALSE, FALSE);
|
||||||
|
Loading…
Reference in New Issue
Block a user