CVS code -
- General:
- Translation updates (see po/ChangeLog for details).
+ - Don't run handle_sigwinch() handler if we're reading in
+ or writing out a file. Global variable jumpok controls
+ when to not run the winch handles, static resizepending
+ is set, handler in main to run handle_sigwinch() when set.
+ Should fix segfaults when nano is initially suspended while
+ reading in a file.
+ *** FIXME: WHo t credit fo finding this bug?
- nano.c:
main()
- Don't call open_file with quiet flag set. Fixes Debian bug
#246956 (no warning when trying to open non-readable file).
+ - Add an extra titlebar() call (useful when reading in a big
+ file).
GNU nano 1.2.3 - 2004.01.17
- General:
int line1ins = 0;
int input_int;
+#ifndef NANO_SMALL
+ jumpok = 0;
+#endif
+
buf = charalloc(bufx);
buf[0] = '\0';
totlines += num_lines;
+#ifndef NANO_SMALL
+ jumpok = 1;
+#endif
return 1;
}
statusbar(_("Cancelled"));
return -1;
}
+
if (!tmp)
titlebar(NULL);
fileptr = fileage;
#ifdef DEBUG
dump_buffer(fileage);
#endif
+#ifndef NANO_SMALL
+ jumpok = 0;
+#endif
f = fdopen(fd, append == 1 ? "ab" : "wb");
if (f == NULL) {
cleanup_and_exit:
free(realname);
free(buf);
+#ifndef NANO_SMALL
+ jumpok = 1;
+#endif
return retval;
}
#ifndef NANO_SMALL
struct stat originalfilestat; /* Stat for the file as we loaded it */
+int jumpok = 0; /* Okay to longjmp back to main loop */
#endif
int editwinrows = 0; /* How many rows long is the edit
static sigjmp_buf jmpbuf; /* Used to return to mainloop after SIGWINCH */
+#ifndef NANO_SMALL
+static int resizepending = 0; /* Got a resize request while reading data */
+#endif
+
/* What we do when we're all set to exit */
RETSIGTYPE finish(int sigage)
{
int result = 0;
struct winsize win;
+ if (!jumpok) {
+ resizepending = 1;
+ return;
+ }
+
if (tty == NULL)
return;
fd = open(tty, O_RDWR);
/* Return here after a sigwinch */
sigsetjmp(jmpbuf, 1);
+#ifndef NANO_SMALL
+ jumpok = 1;
+ if (resizepending) {
+ resizepending = 0;
+ handle_sigwinch(0);
+ }
+#endif
+
/* SHUT UP GCC! */
startline = 0;
fill_flag_used = 0;