Common subdirectories: nano-dlr/CVS and nano-working/CVS diff -u nano-dlr/configure.ac nano-working/configure.ac --- nano-dlr/configure.ac Sat Mar 30 20:54:44 2002 +++ nano-working/configure.ac Sat Mar 30 21:11:33 2002 @@ -17,6 +17,9 @@ AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h) +dnl Turn off assert statements. +AC_DEFINE(NDEBUG) + dnl options AC_ARG_ENABLE(tiny, [ --enable-tiny Disable features for the sake of size @@ -47,8 +50,8 @@ fi]) AC_ARG_ENABLE(multibuffer, -[ --enable-multibuffer Enable multiple file buffers; this is disabled if --enable-tiny is used], -[if test x$enableval = xyes && test x$tiny_support != xyes; then +[ --enable-multibuffer Enable multiple file buffers], +[if test x$enableval = xyes; then AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes fi]) diff -u nano-dlr/files.c nano-working/files.c --- nano-dlr/files.c Sat Mar 30 20:54:54 2002 +++ nano-working/files.c Sat Mar 30 21:37:12 2002 @@ -349,17 +349,17 @@ while (1) { if (stat(buf, &fs) == -1) - break; - if (i == INT_MAX) return buf; + if (i == INT_MAX) + break; i++; strcpy(buf, name); sprintf(&buf[strlen(name)], ".%d", i); } - if (i == INT_MAX) - buf[0] = '\0'; + /* We get here only if there is no possible save file. */ + buf[0] = '\0'; return buf; } @@ -814,6 +814,9 @@ if (!open_files) return 1; + + if (open_files) + open_files->file = fileage; tmp = open_files; if (open_nextfile(1)) { diff -u nano-dlr/global.c nano-working/global.c --- nano-dlr/global.c Sat Mar 30 20:54:44 2002 +++ nano-working/global.c Sat Mar 30 21:01:52 2002 @@ -270,7 +270,10 @@ "", *nano_backspace_msg = "", *nano_tab_msg = "", *nano_enter_msg = "", *nano_cancel_msg = "", *nano_unjustify_msg = "", *nano_append_msg = - ""; + ""; +#ifdef ENABLE_MULTIBUFFER + char *nano_openprev_msg = "", *nano_opennext_msg = ""; +#endif #ifndef NANO_SMALL char *nano_tofiles_msg = "", *nano_gotodir_msg = "", *nano_case_msg = @@ -279,9 +282,6 @@ #ifdef HAVE_REGEX_H char *nano_regexp_msg = "", *nano_bracket_msg = ""; -#endif -#ifdef ENABLE_MULTIBUFFER - char *nano_openprev_msg = "", *nano_opennext_msg = ""; #endif nano_help_msg = _("Invoke the help menu"); Common subdirectories: nano-dlr/intl and nano-working/intl Common subdirectories: nano-dlr/m4 and nano-working/m4 diff -u nano-dlr/nano.1 nano-working/nano.1 --- nano-dlr/nano.1 Sat Mar 30 20:54:44 2002 +++ nano-working/nano.1 Sat Mar 30 21:51:05 2002 @@ -79,7 +79,7 @@ Enable cut from cursor to end of line with ^K. .TP .B \-l (\-\-nofollow) -If the file being edited is a symbolic link, replace the link with a +If the file being edited is a symbolic link, replace the link with a new file, do not follow it. Good for editing files in /tmp, perhaps? .TP .B \-m (\-\-mouse) diff -u nano-dlr/nano.1.html nano-working/nano.1.html --- nano-dlr/nano.1.html Sat Mar 30 20:54:44 2002 +++ nano-working/nano.1.html Sat Mar 30 21:52:01 2002 @@ -108,7 +108,7 @@
-l (--nofollow)
-If the file being edited is a symbolic link, replace the link with a +If the file being edited is a symbolic link, replace the link with a new file, do not follow it. Good for editing files in /tmp, perhaps?
-m (--mouse) diff -u nano-dlr/nano.c nano-working/nano.c --- nano-dlr/nano.c Sat Mar 30 20:54:54 2002 +++ nano-working/nano.c Sat Mar 30 21:23:21 2002 @@ -893,6 +893,12 @@ * word to the next line regardless. */ assert(strlenpt(inptr->data) > fill); +/* The code that changes totsize assumes the following assertion. Even if + * we are wrapping the last line, there should always be a magic line + * after it, so if this assert is false there is a bug elsewhere in nano. + */ + assert(inptr->next != NULL); + /* Step 1, finding where to wrap. We are going to replace a white-space * character with a new-line. In this step, we set wrap_loc as the * location of this replacement. @@ -910,7 +916,7 @@ * Note that the initial indentation does not count as a legal wrap * point if we are going to auto-indent! * - * Note that the code below could be optimised, by not calling strlenpt + * Note that the code below could be optimised, by not calling strnlenpt * so often, and by not calling isspace(inptr->data[i+1]) and then in * the next loop calling isspace(inptr->data[i]). Oh well, fixing the * first point would entail expanding the definition of strnlenpt, which @@ -1070,8 +1076,8 @@ /* if we added another line, add the length of that line and one for the * end-of-line to totsize */ -if (!wrapping) - totsize += (strlen(inptr->next->next->data) + 1); + if (!wrapping) + totsize += (strlen(inptr->next->next->data) + 1); /* the following lines are all copied from do_wrap in version 1.1.7. It * is not clear exactly what they do. */ Common subdirectories: nano-dlr/po and nano-working/po