]> git.wh0rd.org Git - nano.git/commitdiff
Making the four toggles that don't have any effect in restricted mode
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 29 Jul 2015 20:21:45 +0000 (20:21 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Wed, 29 Jul 2015 20:21:45 +0000 (20:21 +0000)
say that they're disabled.

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

ChangeLog
src/nano.c

index ed22f077d8dfa3b44a5093fb5190207911b79e40..190d82d597d269dce1817be4e14d4af5512537e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
        say that this function is disabled than that no linter was defined.
        * src/nano.c (usage): When asking for --help in restricted mode, don't
        show options that don't have any effect.
+       * src/nano.c (do_toggle): Make the four toggles that don't have any
+       effect in restricted mode say that they're disabled.
 
 2015-07-28  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (do_formatter), src/nano.c (allow_pending_sigwinch):
index 32fc9cf7f328101bc43be0d800e0d560000e9e4a..75309e9c7685d00c0e30948b30723f405b05913c 100644 (file)
@@ -1426,6 +1426,12 @@ void do_toggle(int flag)
 {
     bool enabled;
 
+    if (ISSET(RESTRICTED) && (flag == SUSPEND || flag == MULTIBUFFER ||
+                       flag == BACKUP_FILE || flag == NO_COLOR_SYNTAX)) {
+       nano_disabled_msg();
+       return;
+    }
+
     TOGGLE(flag);
 
     switch (flag) {