From dc0ec32de8263be20a1d4b4615bd873024ab355d Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sat, 21 Apr 2007 18:57:47 +0000 Subject: [PATCH] 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/branches/nano_2_0_branch/nano@4092 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/files.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ade7b617..242a99b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,9 @@ CVS code - with no name under an existing file's name. (DLR) - Rename variable different_name to do_warning, for clarity. (DLR) + - 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. (DLR) - Simplify. (DLR) input_tab() - Don't bother checking if num_matches is less than zero, as diff --git a/src/files.c b/src/files.c index 5e07880a..adbd8e65 100644 --- 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") : -- 2.39.5