Commit 7162e3d6 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

DB's latest patch

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 66f373f3
Showing with 293 additions and 391 deletions
+293 -391
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
[FIXED] [FIXED]
- Alt-Z is currently broken to toggle suspend. I guess I still don't know - Alt-Z is currently broken to toggle suspend. I guess I still don't know
signals very well =-) (41) [FIXED]. signals very well =-) (41) [FIXED].
- Unable to cut the entire file using the marker (discovered by Kev Tyler) - Unable to cut the entire file using the marker (discovered by Ken Tyler)
(42). [FIXED] (42). [FIXED]
- The keypad does not work when nano runs in the Gnome terminal (43). [FIXED] - The keypad does not work when nano runs in the Gnome terminal (43). [FIXED]
- When reading in a file, if the file is a directory, the contents of the - When reading in a file, if the file is a directory, the contents of the
......
CVS code - CVS code -
- General:
- Typos n misspellings all over the place (David Benbennick).
- Allow --tiny and --multibuffer to cooperate (who the heck
would want this is beyond me but ;-). Changes to
configure.ac, global.c, , (David Benbennick).
- configure.ac:
- Define NDEBUG to silence asserts (David Benbennick).
- files.c:
get_next_filename()
- Optimizations (David Benbennick).
- global.c:
shortcut_init()
- Add missing free_shortcutage()s (David Benbennick).
- nano.c:
die_save_file()
- Add missing free (David Benbennick).
do_justify()
- Optimizations (David Benbennick).
do_wrap()
- Complete rewrite (David Benbennick).
- nano.h: - nano.h:
- NANO_ALT_COMMAND and NANO_ALT_PERIOD were reversed (lol) - NANO_ALT_COMMAND and NANO_ALT_PERIOD were reversed (lol)
(David Benbennick). (David Benbennick).
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
/* Define this to disable setting of the operating directory (chroot of sorts) */ /* Define this to disable setting of the operating directory (chroot of sorts) */
#undef DISABLE_OPERATINGDIR #undef DISABLE_OPERATINGDIR
/* Define this to enable multiple file buffers; this is disabled if NANO_SMALL is defined */ /* Define this to enable multiple file buffers */
#undef ENABLE_MULTIBUFFER #undef ENABLE_MULTIBUFFER
/* Define this to use the .nanorc file */ /* Define this to use the .nanorc file */
...@@ -71,3 +71,6 @@ ...@@ -71,3 +71,6 @@
/* Define this to enable undoing....something */ /* Define this to enable undoing....something */
#undef ENABLE_UNDO #undef ENABLE_UNDO
/* Shut up the assert warnings :-) */
#undef NDEBUG
...@@ -17,6 +17,9 @@ dnl Checks for header files. ...@@ -17,6 +17,9 @@ dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h) 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 dnl options
AC_ARG_ENABLE(tiny, AC_ARG_ENABLE(tiny,
[ --enable-tiny Disable features for the sake of size [ --enable-tiny Disable features for the sake of size
...@@ -47,8 +50,8 @@ AC_ARG_ENABLE(undo, ...@@ -47,8 +50,8 @@ AC_ARG_ENABLE(undo,
fi]) fi])
AC_ARG_ENABLE(multibuffer, AC_ARG_ENABLE(multibuffer,
[ --enable-multibuffer Enable multiple file buffers; this is disabled if --enable-tiny is used], [ --enable-multibuffer Enable multiple file buffers],
[if test x$enableval = xyes && test x$tiny_support != xyes; then [if test x$enableval = xyes; then
AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes
fi]) fi])
......
...@@ -184,7 +184,7 @@ had no help menu, spell checker, and so forth.  But over time it improved, ...@@ -184,7 +184,7 @@ had no help menu, spell checker, and so forth.  But over time it improved,
and with the help of a few great coders it matured to the (hopefully) stable and with the help of a few great coders it matured to the (hopefully) stable
state it is today. state it is today.
<p><font color="#330000">In February 2001, nano has been declared an <p><font color="#330000">In February 2001, nano has been declared an
official GNU program by Richard Stallman. Nano also reached it's first official GNU program by Richard Stallman. Nano also reached its first
production release on March 22, 2001.</font></blockquote> production release on March 22, 2001.</font></blockquote>
<h2> <h2>
......
...@@ -336,8 +336,8 @@ int open_file(char *filename, int insert, int quiet) ...@@ -336,8 +336,8 @@ int open_file(char *filename, int insert, int quiet)
/* This function will return the name of the first available extension /* This function will return the name of the first available extension
of a filename (starting with the filename, then filename.1, etc). of a filename (starting with the filename, then filename.1, etc).
Memory is allocated for the return value. If no writable extension Memory is allocated for the return value. If no writable extension
exists we return "" */ exists, we return "". */
char *get_next_filename(char *name) char *get_next_filename(const char *name)
{ {
int i = 0; int i = 0;
char *buf = NULL; char *buf = NULL;
...@@ -346,10 +346,10 @@ char *get_next_filename(char *name) ...@@ -346,10 +346,10 @@ char *get_next_filename(char *name)
buf = charalloc(strlen(name) + num_of_digits(INT_MAX) + 2); buf = charalloc(strlen(name) + num_of_digits(INT_MAX) + 2);
strcpy(buf, name); strcpy(buf, name);
while(1) { while (1) {
if (stat(buf, &fs) == -1) if (stat(buf, &fs) == -1)
break; return buf;
if (i == INT_MAX) if (i == INT_MAX)
break; break;
...@@ -358,8 +358,8 @@ char *get_next_filename(char *name) ...@@ -358,8 +358,8 @@ char *get_next_filename(char *name)
sprintf(&buf[strlen(name)], ".%d", i); sprintf(&buf[strlen(name)], ".%d", i);
} }
if (i == INT_MAX) /* We get here only if there is no possible save file. */
buf[0] = '\0'; buf[0] = '\0';
return buf; return buf;
} }
...@@ -376,7 +376,7 @@ int do_insertfile(int loading_file) ...@@ -376,7 +376,7 @@ int do_insertfile(int loading_file)
#endif #endif
#ifndef DISABLE_OPERATINGDIR #ifndef DISABLE_OPERATINGDIR
if ((operating_dir) && (strcmp(operating_dir,"."))){ if (operating_dir && (strcmp(operating_dir, "."))) {
i = statusq(1, insertfile_list, "", _("File to insert [from %s] "), i = statusq(1, insertfile_list, "", _("File to insert [from %s] "),
operating_dir); operating_dir);
} else { } else {
...@@ -643,8 +643,8 @@ int load_open_file(void) ...@@ -643,8 +643,8 @@ int load_open_file(void)
totlines = open_files->file_totlines; totlines = open_files->file_totlines;
totsize = open_files->file_totsize; totsize = open_files->file_totsize;
/* Unset the marker because nano can't (yet) handle marked text flipping between /* Unset the marker because nano can't (yet) handle marked text
open files */ flipping between open files */
UNSET(MARK_ISSET); UNSET(MARK_ISSET);
/* restore full file position: line number, x-coordinate, y- /* restore full file position: line number, x-coordinate, y-
...@@ -815,6 +815,8 @@ int close_open_file(void) ...@@ -815,6 +815,8 @@ int close_open_file(void)
if (!open_files) if (!open_files)
return 1; return 1;
open_files->file = fileage;
tmp = open_files; tmp = open_files;
if (open_nextfile(1)) { if (open_nextfile(1)) {
if (open_prevfile(1)) if (open_prevfile(1))
......
...@@ -99,7 +99,9 @@ shortcut *writefile_list = NULL; ...@@ -99,7 +99,9 @@ shortcut *writefile_list = NULL;
shortcut *insertfile_list = NULL; shortcut *insertfile_list = NULL;
shortcut *help_list = NULL; shortcut *help_list = NULL;
shortcut *spell_list = NULL; shortcut *spell_list = NULL;
#ifndef NANO_SMALL
shortcut *extcmd_list = NULL; shortcut *extcmd_list = NULL;
#endif
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
shortcut *browser_list = NULL; shortcut *browser_list = NULL;
#endif #endif
...@@ -272,6 +274,10 @@ void shortcut_init(int unjustify) ...@@ -272,6 +274,10 @@ void shortcut_init(int unjustify)
"", *nano_unjustify_msg = "", *nano_append_msg = "", *nano_unjustify_msg = "", *nano_append_msg =
""; "";
#ifdef ENABLE_MULTIBUFFER
char *nano_openprev_msg = "", *nano_opennext_msg = "";
#endif
#ifndef NANO_SMALL #ifndef NANO_SMALL
char *nano_tofiles_msg = "", *nano_gotodir_msg = "", *nano_case_msg = char *nano_tofiles_msg = "", *nano_gotodir_msg = "", *nano_case_msg =
"", *nano_reverse_msg = "", *nano_execute_msg = ""; "", *nano_reverse_msg = "", *nano_execute_msg = "";
...@@ -280,9 +286,6 @@ void shortcut_init(int unjustify) ...@@ -280,9 +286,6 @@ void shortcut_init(int unjustify)
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
char *nano_regexp_msg = "", *nano_bracket_msg = ""; char *nano_regexp_msg = "", *nano_bracket_msg = "";
#endif #endif
#ifdef ENABLE_MULTIBUFFER
char *nano_openprev_msg = "", *nano_opennext_msg = "";
#endif
nano_help_msg = _("Invoke the help menu"); nano_help_msg = _("Invoke the help menu");
nano_writeout_msg = _("Write the current file to disk"); nano_writeout_msg = _("Write the current file to disk");
...@@ -650,6 +653,9 @@ void shortcut_init(int unjustify) ...@@ -650,6 +653,9 @@ void shortcut_init(int unjustify)
nano_execute_msg, 0, 0, 0, NOVIEW, 0); nano_execute_msg, 0, 0, 0, NOVIEW, 0);
#endif #endif
if (spell_list != NULL)
free_shortcutage(&spell_list);
sc_init_one(&spell_list, NANO_HELP_KEY, sc_init_one(&spell_list, NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help); _("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
...@@ -657,6 +663,9 @@ void shortcut_init(int unjustify) ...@@ -657,6 +663,9 @@ void shortcut_init(int unjustify)
nano_cancel_msg, 0, 0, 0, VIEW, 0); nano_cancel_msg, 0, 0, 0, VIEW, 0);
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (extcmd_list != NULL)
free_shortcutage(&extcmd_list);
sc_init_one(&extcmd_list, NANO_HELP_KEY, sc_init_one(&extcmd_list, NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help); _("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
......
...@@ -79,7 +79,7 @@ source code. ...@@ -79,7 +79,7 @@ source code.
Enable cut from cursor to end of line with ^K. Enable cut from cursor to end of line with ^K.
.TP .TP
.B \-l (\-\-nofollow) .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? a new file, do not follow it. Good for editing files in /tmp, perhaps?
.TP .TP
.B \-m (\-\-mouse) .B \-m (\-\-mouse)
......
...@@ -108,7 +108,7 @@ Enable cut from cursor to end of line with ^K. ...@@ -108,7 +108,7 @@ Enable cut from cursor to end of line with ^K.
<DT><B>-l (--nofollow)</B> <DT><B>-l (--nofollow)</B>
<DD> <DD>
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? a new file, do not follow it. Good for editing files in /tmp, perhaps?
<DT><B>-m (--mouse)</B> <DT><B>-m (--mouse)</B>
......
This diff is collapsed.
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "nano.h" #include "nano.h"
extern int editwinrows; extern int editwinrows;
extern int current_x, current_y, posible_max, totlines; extern int current_x, current_y, totlines;
extern int placewewant; extern int placewewant;
extern int mark_beginx, samelinewrap; extern int mark_beginx, samelinewrap;
extern long totsize; extern long totsize;
...@@ -72,7 +72,10 @@ extern shortcut *shortcut_list; ...@@ -72,7 +72,10 @@ extern shortcut *shortcut_list;
extern shortcut *main_list, *whereis_list; extern shortcut *main_list, *whereis_list;
extern shortcut *replace_list, *goto_list; extern shortcut *replace_list, *goto_list;
extern shortcut *writefile_list, *insertfile_list; extern shortcut *writefile_list, *insertfile_list;
extern shortcut *spell_list, *replace_list_2, *extcmd_list; extern shortcut *spell_list, *replace_list_2;
#ifndef NANO_SMALL
extern shortcut *extcmd_list;
#endif
extern shortcut *help_list; extern shortcut *help_list;
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
extern shortcut *browser_list, *gotodir_list; extern shortcut *browser_list, *gotodir_list;
...@@ -87,7 +90,7 @@ extern regmatch_t regmatches[10]; ...@@ -87,7 +90,7 @@ extern regmatch_t regmatches[10];
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
extern regex_t color_regexp; extern regex_t color_regexp;
extern regmatch_t colormatches[1]; extern regmatch_t colormatches[1];
#endif /* HJAVE_COLOR */ #endif /* ENABLE_COLOR */
#endif #endif
extern toggle *toggles; extern toggle *toggles;
...@@ -152,7 +155,7 @@ void shortcut_init(int unjustify); ...@@ -152,7 +155,7 @@ void shortcut_init(int unjustify);
void signal_init(void); void signal_init(void);
void lowercase(char *src); void lowercase(char *src);
void blank_bottombars(void); void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch); void check_wrap(filestruct * inptr);
void dump_buffer(filestruct * inptr); void dump_buffer(filestruct * inptr);
void align(char **strp); void align(char **strp);
void edit_refresh(void), edit_refresh_clearok(void); void edit_refresh(void), edit_refresh_clearok(void);
...@@ -172,7 +175,6 @@ void previous_line(void); ...@@ -172,7 +175,6 @@ void previous_line(void);
void center_cursor(void); void center_cursor(void);
void bottombars(shortcut *s); void bottombars(shortcut *s);
void blank_statusbar_refresh(void); void blank_statusbar_refresh(void);
void *nmalloc (size_t howmuch);
void nperror(const char *s); void nperror(const char *s);
void *mallocstrcpy(char *dest, char *src); void *mallocstrcpy(char *dest, char *src);
void wrap_reset(void); void wrap_reset(void);
...@@ -221,7 +223,6 @@ int load_open_file(void), close_open_file(void); ...@@ -221,7 +223,6 @@ int load_open_file(void), close_open_file(void);
int do_page_up(void), do_page_down(void); int do_page_up(void), do_page_down(void);
int do_cursorpos(int constant), do_cursorpos_void(void), do_spell(void); int do_cursorpos(int constant), do_cursorpos_void(void), do_spell(void);
int do_up(void), do_down (void), do_right(void), do_left (void);
int do_home(void), do_end(void), total_refresh(void), do_mark(void); int do_home(void), do_end(void), total_refresh(void), do_mark(void);
int do_delete(void), do_backspace(void), do_tab(void), do_justify(void); int do_delete(void), do_backspace(void), do_tab(void), do_justify(void);
int do_first_line(void), do_last_line(void); int do_first_line(void), do_last_line(void);
...@@ -234,7 +235,7 @@ int open_prevfile_void(void), open_nextfile_void(void); ...@@ -234,7 +235,7 @@ int open_prevfile_void(void), open_nextfile_void(void);
#endif #endif
char *charalloc (size_t howmuch); char *charalloc (size_t howmuch);
char *get_next_filename(char *name); char *get_next_filename(const char *name);
#if !defined (DISABLE_SPELLER) || !defined (DISABLE_OPERATINGDIR) #if !defined (DISABLE_SPELLER) || !defined (DISABLE_OPERATINGDIR)
char *get_full_path(const char *origpath); char *get_full_path(const char *origpath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment