2011-03-03 Chris Allegretta <chrisa@asty.org>
* color.c (color_update): Remove unneeded debugging message from
libmagic commit. Fixed extra messages going to stderr reported by Mike Frysinger.
Chris Allegretta [Sat, 26 Feb 2011 14:22:37 +0000 (14:22 +0000)]
2011-02-26 Chris Allegretta <chrisa@asty.org>
* Change RAW in function_type enum to RAWINPUT, to fix compilation on AIX,
reported by Richard G Daniel <skunk@iskunk.org>.
Chris Allegretta [Thu, 24 Feb 2011 02:47:25 +0000 (02:47 +0000)]
2011-02-23 Chris Allegretta <chrisa@asty.org>
* Fix some more severe warnings from 'g++ -pedantic', from patch originally
by Eitan Adler <lists@eitanadler.com>
Chris Allegretta [Wed, 23 Feb 2011 03:09:23 +0000 (03:09 +0000)]
2011-02-22 Chris Allegretta <chrisa@asty.org>
* color.c (nfreeregex): Fix that we were trying to set the pointer passed by value
to NULL. Fixes crashes on file save reported by Ken Tyler and Matthieu Lejeune.
Chris Allegretta [Fri, 18 Feb 2011 07:49:28 +0000 (07:49 +0000)]
* files.c (load_history): Set last_search to the last search value we loaded from history,
so do_research will succeed without needing to manually load the last seach in. Fixes
bug reported by Matt "ML" at gmail.
Chris Allegretta [Fri, 18 Feb 2011 07:30:57 +0000 (07:30 +0000)]
2011-02-18 Chris Allegretta <chrisa@asty.org>
* New saved cursor position history option. Command line option -P or --poslog, rc file
entry "poslog". Search history changes to ~/.nano/search_history, cursor position log
is ~/.nano/filepos_history. Added checks to move the legacy .nano_history file to the new
location. Several new functions to files.c: load_poshistory(), save_poshistory(),
check_poshistory(), update_poshistory(), and reworking of histfilename(). New FAQ entry
4.15 discussing the change and offering an interoperability workaround.
Chris Allegretta [Sun, 13 Feb 2011 04:23:10 +0000 (04:23 +0000)]
2011-02-12 Chris Allegretta <chrisa@asty.org>
* Initial libmagic implementation, adapted from Eitan Adler <eitanadlerlist@gmail.com>.
New nanorc entry "magic" to enable this functionality, nanorc file and man page updates.
* src/*: Retire iso_me_harder_funcmap based on suggestion by <bernd.spaeth@gmx.net>
This does add 20KB to nano's executable size but it gets rid of a lot of indirection
that makes people stomach turn. There are several new stub functions and need of more
tidying as a result of this.
2011-02-06 Chris Allegretta <chrisa@asty.org>
* files.c (write_file) - Fix problems with writing the backup file (albeit interactively)
with new function prompt_failed_backupwrite(), allows more secure handling of problems
with failing to write the backup file compared to 'allow_insecure_backup'.
* winio.c (edit_redraw): Removed unused variable
Chris Allegretta [Fri, 12 Nov 2010 06:22:12 +0000 (06:22 +0000)]
2010-11-12 Chris Allegretta <chrisa@asty.org>
* Add check for RESTRICTED mode back to speller, suspend and insert file
routines, since adding key bindings broke the fact that they should be
disabled in restricted mode. Fixes Savannah bug 31625 reported by
Charlie Somerville.
Chris Allegretta [Mon, 21 Jun 2010 03:10:10 +0000 (03:10 +0000)]
2010-06-20 Chris Allegretta <chrisa@asty.org>
* New option allow_insecure_backup, allows the previous security
fixes for backup files to be overridden if you're really positive
you want to. Fixes Savannah bug 29732 by Brian Szymanski <skibrianski>.
Chris Allegretta [Sun, 23 May 2010 04:30:23 +0000 (04:30 +0000)]
2010-05-23 Chris Allegretta <chrisa@asty.org>
* files.c (write_file): Don't even try to chown() the backup
file unless we're root, since it's probably going to fail if
we're editing a file we don't own. Fixes Savannah bug
29514: [nano 2.2.2] backup should ignore chown errors.
Chris Allegretta [Wed, 14 Apr 2010 21:55:39 +0000 (21:55 +0000)]
2010-04-07 Chris Allegretta <chrisa@asty.org>
* doc/man/nano.1,nanorc.5: Remove the backup file warnings now
that a sufficient security fix exists for the backup file code.
Chris Allegretta [Wed, 14 Apr 2010 06:03:12 +0000 (06:03 +0000)]
2010-04-14 Chris Allegretta <chrisa@asty.org>
* files.c (wirte_file): Don't set current_stat when tmp == TRUE, check
whether current_stat is set when trying to use it, and don't do the
modification check if the filename changed, since we have no way
of knowing about it in that case. Fixes Savannah bug 29392, reported
by Mike Frysinger.
Chris Allegretta [Wed, 14 Apr 2010 03:14:40 +0000 (03:14 +0000)]
2010-04-09 Chris Allegretta <chrisa@asty.org>
* text.c (do_alt_speller): Skip invoking the alt speller if the file size
is 0 bytes. Fixes Savannah bug 29393 reported by Mike Frysinger.
2010-04-09 Chris Allegretta <chrisa@asty.org>
* files.c (do_writeout): Better security fixes for backup file writing,
mangled from submission by Dan Rosenberg <dan.j.rosenberg at gmail>.
2010-04-02 Chris Allegretta <chrisa@asty.org>
* files.c (do_writeout): Previous fixes should not cause a crash
when saving a new file. Discovered by Mike Frysinger <vapier@gentoo.org>.
2010-04-07 Chris Allegretta <chrisa@asty.org>
* doc/man/nano.1,nanorc.5: Add warnings about using backup
mode as root due to the Dan Rosenberg security analysis.
2010-04-02 Chris Allegretta <chrisa@asty.org>
* files.c (do_writeout): Expand modification check to include both the
original file's device ID and inode number as reasons to warn the
user that the file has been modified. Based on security article on nano
by Dan Rosenberg.
Chris Allegretta [Sun, 21 Mar 2010 05:31:43 +0000 (05:31 +0000)]
2010-03-21 Chris Allegretta <chrisa@asty.org>
* nano.c (page_stdin et al): Don't attempt to reset/reopen the terminal
settings when reading stdin if it was aborted with SIGINT. May fix Savannah
bug 29114 reported by Mike Frysinger.
Chris Allegretta [Sun, 21 Mar 2010 04:35:17 +0000 (04:35 +0000)]
* move.c (do_page_up): Explicitly set current_y to 0 when paging up when not in
smooth scroll mode, as previous fixes would otherwise cause the cursor to not
really be moved to the stop of the screen.
2010-03-07 Chris Allegretta <chrisa@asty.org>
* configure.ac, nano.c (handle_sigwinch): Create check for whether LINES and
COLS can safely be redefined. Fixes compilation issues with cygwin, and likely
with newer versions of ncurses, fixes Savannah bug 28984 repoted by Andy Koppe
and Eric Oliver via mailing list.
* winio.c (get_mouseinput) - fix stray semicolon in code, also reported in
bug 28984.
Chris Allegretta [Fri, 29 Jan 2010 03:40:58 +0000 (03:40 +0000)]
2010-01-28 Chris Allegretta <chrisa@asty.org>
* move.c (do_page_up, do_page_down): Fix for smooth mode not preserving cusor
position. Part one of fix for Savannah bug 21178 by Mike Frysinger.
Chris Allegretta [Sun, 17 Jan 2010 05:30:22 +0000 (05:30 +0000)]
2010-01-17 Chris Allegretta <chrisa@asty.org>
* nano.c (main), prompt.c (do_statusbar_input): Handle problems with an unmapped
function due to key rebinding, fixes crashes on FreeBSD repoted by Eitan
Adler <eitanadlerlist@gmail.com>.
Chris Allegretta [Thu, 14 Jan 2010 06:32:37 +0000 (06:32 +0000)]
2010-01-14 Chris Allegretta <chrisa@asty.org>
* files.c (do_writeout): Fix for crash / incorrect external modification warning
due to earlier fix in r4467.
Chris Allegretta [Wed, 13 Jan 2010 03:21:19 +0000 (03:21 +0000)]
2010-01-12 Chris Allegretta <chrisa@asty.org>
* move.c (do_page_up, do_page_down): Fix issues with not enough scrolling down/up
and cursor centering.
* winio.c (edit_scroll): Remove lots of needless checking of line length for
soft wrapping code.
* winio.c (edit_update) - Remove extra code for when updating with old_current outside
of the new buffer boundary and centering issues.
2010-01-04 Chris Allegretta <chrisa@asty.org>
* winio.c: edit_update, edit_redraw - Fix search not scrolling to the middle of the screen
(reported by alpha@qzx.com) and places where we rely on maxrows but should not.
Chris Allegretta [Wed, 23 Dec 2009 05:03:09 +0000 (05:03 +0000)]
2009-12-22 Chris Allegretta <chrisa@asty.org>
* files.c (write_file): Fix compatibility with previous stat fix and tiny mode.
2009-12-22 David Lawrence Ramsey <pooka109@gmail.com>
* global.c: Add new strings for forward/back in the file browser. New variables
nano_forwardfile_msg and nano_backfile_msg.
Chris Allegretta [Sun, 20 Dec 2009 05:55:41 +0000 (05:55 +0000)]
2009-12-20 Chris Allegretta <chrisa@asty.org>
* files.c (is_file_writable): remove assert check for f, since it's not
initialized at the time. Fixes Savannah bug 28309, reported by Zoltan Kovacs.
Chris Allegretta [Sun, 20 Dec 2009 05:46:35 +0000 (05:46 +0000)]
2009-12-20 Brian Szymanski <skibrianski via Savannah>
* src/files.c (write_file): Check stat struct exists, and if not use just obtained stat data.
Fixes Ubuntu bug 471568, "reproducible crash in nano on trying to save to a file
different than the one specified on the command line".
Chris Allegretta [Tue, 15 Dec 2009 18:07:17 +0000 (18:07 +0000)]
2009-12-15 Chris Allegretta <chrisa@asty.org>
* doc/nanorc.sample.in - Remove erroneous 'set suspendenable' as it's actually a
key binding (e.g. 'bind M-Z suspendenable all') and not a settable flag. Fixes
Savannah bug 28299 reported by Mike Frysinger.
Chris Allegretta [Sat, 12 Dec 2009 22:21:20 +0000 (22:21 +0000)]
2009-12-12 Chris Allegretta <chrisa@asty.org>
* text.c (do_delete), nano.c (do_output): Add check for length of current line
before and after adding/deleting text, and do full refresh if it is now
a different multiple of COLS. Also get rid of superfluous do_refresh
vars now that we have edit_refresh_needed.
2009-12-07 David Lawrence Ramsey <pooka109@gmail.com>
* global.c (shortcut_init), browser.c (do_browser): Fix M-W not being bound to
research in either main menu or browser.
2009-12-09 Chris Allegretta <chrisa@asty.org>
* files.c (read_file) - Add parameter for whether we should even try to check
file writability, as the message is useless when we're inserting into an
existing buffer. Fixes Savannah bug 28219.
2009-12-07 David Lawrence Ramsey <pooka109@gmail.com>
* global.c (shortcut_init): Many fixes for keybindings code oversights, including
restore page up/down and GotoDir to browser,
* browser.c (do_browser): Fix breaking out of a submenu (e.g. gotodir) breaks out
of browser altogether.
* doc/nanorc.sample.in: Add missing entries for fortran/ObjC/OCaml entries.
2009-12-03 David Lawrence Ramsey <pooka109@gmail.com>
* global.c (shortcut_init) - Remove help shortcut from help shortcut list :-) Tweaked
to reorder exit shortcut to end of list to not mess up prev/next shortcut symmetry.
2009-12-03 Eitan Adler <eitanadlerlist@gmail.com>
* doc/syntax/makefile.nanorc - Fix poor regex for all alpha characters which sometimes leads to
error messages, reported by gibboris@gmail.com.
2009-12-02 Chris Allegretta <chrisa@asty.org>
* text.c (add_undo, do_undo, do_redo) - Do not execute cases for SPLIT when DISABLE_WRAPPING
is defined. Fixes Savannah bug 28151 (anon).
2009-12-01 David Lawrence Ramsey <pooka109@gmail.com>
* Update documentation for 2.2 features including sample nanorc file, texinfo
file, man pages, UPGRADE file, and update copyright noticed for the current year.
2009-12-01 Kamil Dudka <kdudka@redhat.com>
* chars.c, file.c - Better handle unused results for things like mbtowc(), new
macro IGNORE_CALL_RESULT.
2009-12-01 Chris Allegretta <chrisa@asty.org>
* global.c (shortcut_init) - Remove redundant entries for ^Y/^V reported by
Christian Weisgerber.
* doc/man/nanorc.5 - Fix typo in Meta documentation, reported by gibboris@gmail.com.
2009-11-29 David Lawrence Ramsey <pooka109@gmail.com>
* global.c (shortcut_init) - Add support for ^P and ^N in the help menu.
Chris Allegretta [Sun, 29 Nov 2009 06:24:10 +0000 (06:24 +0000)]
2009-11-29 David Lawrence Ramsey <pooka109@gmail.com>
* global.c: Fix replace and insert file initializations for proper compilation options.
* nano.c (do_suspend): Update comments to reflect actual code path, bad Chris and thanks for
noticing Jordi.
* configure.ac: Fix typos
Chris Allegretta [Sun, 29 Nov 2009 06:13:22 +0000 (06:13 +0000)]
2009-11-29 Chris Allegretta <chrisa@asty.org>
* prompt.c (get_prompt_string) - Universally handle help key when is disabled. Fixes Savannah
bug 28117 by David Lawrence Ramsey <pooka109@gmail.com>.
* chars.c, files.c: Add junk vars to silence the compiler. Sigh.
2009-11-29 David Lawrence Ramsey <pooka109@gmail.com>
* Change several *chars to const char, additional cleanups and casts to make compilers happier.
Chris Allegretta [Sat, 28 Nov 2009 03:01:30 +0000 (03:01 +0000)]
2009-11-27 Chris Allegretta <chrisa@asty.org>
* nano.c (do_suspend): Don't clear the screen but do move the cursor down to the last line
first in an effort to not corrupt the screen, which contradicts Pico but is consistent
with almost all other text editors. Fixes Savannah bug 28110/Debian bug 460510
reported by Tim Connors <reportbug@rather.puzzling.org>.
Chris Allegretta [Tue, 24 Nov 2009 17:15:53 +0000 (17:15 +0000)]
2009-11-24 Chris Allegretta <chrisa@asty.org>
* move.c (do_page_up, do_page_down): Make these functions work better with soft
line wrapping.
* winio.c (compute_maxrows): Make maxrows calculation more accurate when all lines are > COLS.
Chris Allegretta [Sun, 22 Nov 2009 21:35:56 +0000 (21:35 +0000)]
2009-11-22 Chris Allegretta <chrisa@asty.org>
* nano.c (main): Allow edit_refresh_needed to take effect when using --enable-tiny
(fixes Savannah bug 28076 reported by David Lawrence Ramsey).
2009-11-22 David Lawrence Ramsey <pooka109@gmail.com>
* nano.c (move_to_filestruct): Fix bug 71 (cut at top of line recenters)
* Fix compilation with --enable-tiny
Chris Allegretta [Fri, 20 Nov 2009 05:09:12 +0000 (05:09 +0000)]
2009-11-19 Chris Allegretta <chrisa@asty.org>
* nano.c (die_save_file) Try nd match the permissions of the file we were
editing but only make a minimal effort to do so. Fixes Savannah bug 27273
reported by Mike Frysinger.
Chris Allegretta [Mon, 16 Nov 2009 00:15:45 +0000 (00:15 +0000)]
2009-11-15 Chris Allegretta <chrisa@asty.org>
* winio.c (edit_refresh): Always computer maxsize regardless of whether smooth scrolling
is enabled. Fixes Savannah bug 28024 by Mike Frysinger.