Index: ChangeLog =================================================================== RCS file: /cvsroot/nano/nano/ChangeLog,v retrieving revision 1.795.2.11 diff -u -r1.795.2.11 ChangeLog --- ChangeLog 15 May 2004 00:08:50 -0000 1.795.2.11 +++ ChangeLog 20 Jun 2004 00:57:07 -0000 @@ -1,10 +1,18 @@ 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. - 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: Index: files.c =================================================================== RCS file: /cvsroot/nano/nano/Attic/files.c,v retrieving revision 1.216.2.1 diff -u -r1.216.2.1 files.c --- files.c 27 Dec 2003 16:35:21 -0000 1.216.2.1 +++ files.c 20 Jun 2004 00:57:31 -0000 @@ -165,6 +165,10 @@ int line1ins = 0; int input_int; +#ifndef NANO_SMALL + jumpok = 0; +#endif + buf = charalloc(bufx); buf[0] = '\0'; @@ -334,6 +338,9 @@ totlines += num_lines; +#ifndef NANO_SMALL + jumpok = 1; +#endif return 1; } @@ -1346,6 +1353,7 @@ statusbar(_("Cancelled")); return -1; } + if (!tmp) titlebar(NULL); fileptr = fileage; @@ -1487,6 +1495,9 @@ #ifdef DEBUG dump_buffer(fileage); #endif +#ifndef NANO_SMALL + jumpok = 0; +#endif f = fdopen(fd, append == 1 ? "ab" : "wb"); if (f == NULL) { @@ -1698,6 +1709,9 @@ cleanup_and_exit: free(realname); free(buf); +#ifndef NANO_SMALL + jumpok = 1; +#endif return retval; } Index: global.c =================================================================== RCS file: /cvsroot/nano/nano/Attic/global.c,v retrieving revision 1.111 diff -u -r1.111 global.c --- global.c 5 Aug 2003 19:31:12 -0000 1.111 +++ global.c 20 Jun 2004 00:57:36 -0000 @@ -44,6 +44,7 @@ #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 Index: nano.c =================================================================== RCS file: /cvsroot/nano/nano/Attic/nano.c,v retrieving revision 1.338.2.3 diff -u -r1.338.2.3 nano.c --- nano.c 15 May 2004 00:08:52 -0000 1.338.2.3 +++ nano.c 20 Jun 2004 00:58:17 -0000 @@ -63,6 +63,10 @@ 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) { @@ -2849,6 +2853,11 @@ int result = 0; struct winsize win; + if (!jumpok) { + resizepending = 1; + return; + } + if (tty == NULL) return; fd = open(tty, O_RDWR); @@ -3445,6 +3454,14 @@ /* 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; Index: proto.h =================================================================== RCS file: /cvsroot/nano/nano/Attic/proto.h,v retrieving revision 1.122.2.1 diff -u -r1.122.2.1 proto.h --- proto.h 27 Dec 2003 16:35:21 -0000 1.122.2.1 +++ proto.h 20 Jun 2004 00:58:24 -0000 @@ -116,6 +116,7 @@ #ifndef NANO_SMALL extern toggle *toggles; +extern int jumpok; #endif #ifndef NANO_SMALL