Commit d455fa10 authored by Thomas Roessler's avatar Thomas Roessler

Fix a couple of segfaults related to using curses when it isn't there.

parent 8a665d15
......@@ -244,23 +244,24 @@ void mutt_show_error (void)
void mutt_endwin (const char *msg)
{
if (!option (OPTNOCURSES))
{
#ifdef SLANG_CURSES
CLEARLINE (LINES - 1);
move (LINES - 1, 0)
CLEARLINE (LINES - 1);
move (LINES - 1, 0)
#else
move (LINES - 1, COLS - 1);
CLEARLINE (LINES - 1);
move (LINES - 1, COLS - 1);
CLEARLINE (LINES - 1);
#endif
attrset (A_NORMAL);
mutt_refresh ();
endwin ();
attrset (A_NORMAL);
mutt_refresh ();
endwin ();
#ifndef SLANG_CURSES
fputc ('\n', stdout);
fputc ('\n', stdout);
#endif
}
if (msg)
puts (msg);
}
......
......@@ -106,23 +106,25 @@ static int dotlock_file (const char *path, int retry)
retry_lock:
mutt_clear_error();
if((r = invoke_dotlock(path, flags, retry)) == DL_EX_EXIST
&& !option (OPTNOCURSES))
if((r = invoke_dotlock(path, flags, retry)) == DL_EX_EXIST)
{
char msg[LONG_STRING];
snprintf(msg, sizeof(msg), _("Lock count exceeded, remove lock for %s?"),
path);
if(retry && mutt_yesorno(msg, 1) == 1)
if (!option (OPTNOCURSES))
{
flags |= DL_FL_FORCE;
retry--;
goto retry_lock;
char msg[LONG_STRING];
snprintf(msg, sizeof(msg), _("Lock count exceeded, remove lock for %s?"),
path);
if(retry && mutt_yesorno(msg, 1) == 1)
{
flags |= DL_FL_FORCE;
retry--;
goto retry_lock;
}
}
else
{
mutt_error ( _("Can't dotlock %s.\n"), path);
}
}
else if (option (OPTNOCURSES))
{
mutt_error ( _("Can't dotlock %s.\n"), path);
}
return (r == DL_EX_OK ? 0 : -1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment