+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.
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);
}
#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
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();