/* Global variables. */
#ifndef NANO_TINY
-sigjmp_buf jmpbuf;
+sigjmp_buf jump_buf;
/* Used to return to main() or the unjustify routine in
* do_justify() after a SIGWINCH. */
+bool jump_buf_main = FALSE;
+ /* Have we set jump_buf so that we return to main() after a
+ * SIGWINCH? */
#endif
#ifndef DISABLE_WRAPJUSTIFY
currshortcut = main_list;
total_refresh();
- /* Jump back to the main loop. */
- siglongjmp(jmpbuf, 1);
+ /* Jump back to either main() or the unjustify routine in
+ * do_justify(). */
+ siglongjmp(jump_buf, 1);
}
/* If allow is TRUE, block any SIGWINCH signals that we get, so that we
reset_cursor();
#ifndef NANO_TINY
- /* Return here after a SIGWINCH. */
- sigsetjmp(jmpbuf, 1);
+ if (!jump_buf_main) {
+ /* If we haven't already, we're going to set jump_buf so
+ * that we return here after a SIGWINCH. Indicate this. */
+ jump_buf_main = TRUE;
+
+ /* Return here after a SIGWINCH. */
+ sigsetjmp(jump_buf, 1);
+ }
#endif
/* If constant cursor position display is on, and there are no
/* Public externs. See global.c for descriptions of them. */
#ifndef NANO_TINY
-extern sigjmp_buf jmpbuf;
+extern sigjmp_buf jump_buf;
+extern bool jump_buf_main;
#endif
#ifndef DISABLE_WRAPJUSTIFY
edit_refresh();
#ifndef NANO_TINY
+ /* We're going to set jump_buf so that we return here after a
+ * SIGWINCH instead of to main(). Indicate this. */
+ jump_buf_main = FALSE;
+
/* Return here after a SIGWINCH. */
- sigsetjmp(jmpbuf, 1);
+ sigsetjmp(jump_buf, 1);
#endif
statusbar(_("Can now UnJustify!"));