nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7622ca045658332764c125c5cef84982cc2c5c8c
parent ea8f3c5271886f9d30870455199fe9361930b4c8
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sat, 21 Apr 2007 18:57:47 +0000

in do_writeout(), if we're in restricted mode, we're not allowed to
write selections to files, so don't display the "Write Selection to
File" prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4092 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 3+++
Msrc/files.c | 6+++++-
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,8 @@ 2007-04-21 David Lawrence Ramsey <pooka109@gmail.com> + * files.c (do_writeout): If we're in restricted mode, we're not + allowed to write selections to files, so don't display the + "Write Selection to File" prompt. * files.c (do_writeout): Simplify. 2007-04-19 David Lawrence Ramsey <pooka109@gmail.com> diff --git a/src/files.c b/src/files.c @@ -1796,7 +1796,11 @@ bool do_writeout(bool exiting) backupstr = ISSET(BACKUP_FILE) ? _(" [Backup]") : ""; - if (!exiting && openfile->mark_set) + /* If we're using restricted mode, don't display the "Write + * Selection to File" prompt. This is disabled, since it allows + * reading from or writing to files not specified on the command + * line. */ + if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set) msg = (append == PREPEND) ? _("Prepend Selection to File") : (append == APPEND) ? _("Append Selection to File") :