Reenabling SIGWINCH-es also when invocation of the formatter fails,

and correcting some comments.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5324 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-07-28 19:39:34 +00:00
parent c7f5691637
commit bff6a905af
3 changed files with 15 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2015-07-28 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_formatter), src/nano.c (allow_pending_sigwinch):
Reenable SIGWINCH-es also when invoking the formatter fails, and
correct some comments.
2015-07-26 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_replace_loop): When doing regex replacements, find
each zero-length match only once. This fixes Savannah bug #45626.

View File

@ -1396,12 +1396,13 @@ void regenerate_screen(void)
total_refresh();
}
/* If allow is TRUE, block any SIGWINCH signals that we get, so that we
* can deal with them later. If allow is FALSE, unblock any SIGWINCH
/* If allow is FALSE, block any SIGWINCH signals that we get, so that
* we can deal with them later. If allow is TRUE, unblock any SIGWINCH
* signals that we have, so that we can deal with them now. */
void allow_pending_sigwinch(bool allow)
{
sigset_t winch;
sigemptyset(&winch);
sigaddset(&winch, SIGWINCH);
sigprocmask(allow ? SIG_UNBLOCK : SIG_BLOCK, &winch, NULL);

View File

@ -3292,8 +3292,8 @@ void do_formatter(void)
}
#ifndef NANO_TINY
/* Don't handle a pending SIGWINCH until the alternate format checker
* is finished and we've loaded the format-checked file back in. */
/* Don't handle any SIGWINCHes until the formatter has finished and
* we've loaded the reformatted file back in. */
allow_pending_sigwinch(FALSE);
#endif
@ -3323,17 +3323,17 @@ void do_formatter(void)
do_gotopos(lineno_save, current_x_save, current_y_save, pww_save);
set_modified();
#ifndef NANO_TINY
/* Handle a pending SIGWINCH again. */
allow_pending_sigwinch(TRUE);
#endif
finalstatus = _("Finished formatting");
}
unlink(temp);
free(temp);
#ifndef NANO_TINY
/* Handle SIGWINCHes again. */
allow_pending_sigwinch(TRUE);
#endif
/* If the formatter printed any error messages onscreen, make
* sure that they're cleared off. */
total_refresh();