Commit ab53864d authored by Chris Allegretta's avatar Chris Allegretta
Browse files

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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 8deebeb9
Showing with 29 additions and 6 deletions
+29 -6
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.
GNU nano 2.2.5 - 2010.08.05
2010-08-04 Lauri Kasanen <curaga@operamail.comcuraga@operamail.com>
* doc/syntax/mgp.nanorc: New Magicpoint syntax highlighting definition
......
......@@ -1066,6 +1066,12 @@ void do_insertfile(
* allow inserting a file into a new buffer. */
void do_insertfile_void(void)
{
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
#ifdef ENABLE_MULTIBUFFER
if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER))
statusbar(_("Key invalid in non-multibuffer mode"));
......
......@@ -690,7 +690,8 @@ void shortcut_init(bool unjustify)
* restricted mode, inserting files is disabled, since it allows
* reading from or writing to files not specified on the command
* line. */
add_to_funcs(!ISSET(RESTRICTED) ? DO_INSERTFILE_VOID : NANO_DISABLED_MSG,
add_to_funcs(DO_INSERTFILE_VOID,
/* TRANSLATORS: Try to keep this at most 10 characters. */
MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE,
#ifdef ENABLE_MULTIBUFFER
......@@ -732,10 +733,9 @@ void shortcut_init(bool unjustify)
* because it allows reading from or writing to files not specified
* on the command line. */
#ifndef DISABLE_SPELLER
if (!ISSET(RESTRICTED))
/* TRANSLATORS: Try to keep this at most 10 characters. */
add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg),
TRUE, NOVIEW);
/* TRANSLATORS: Try to keep this at most 10 characters. */
add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg),
TRUE, NOVIEW);
#endif
add_to_funcs(DO_FIRST_LINE,
......
......@@ -1185,6 +1185,12 @@ RETSIGTYPE handle_hupterm(int signal)
/* Handler for SIGTSTP (suspend). */
RETSIGTYPE do_suspend(int signal)
{
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
#ifndef DISABLE_MOUSE
/* Turn mouse support off. */
disable_mouse_support();
......@@ -1212,7 +1218,7 @@ RETSIGTYPE do_suspend(int signal)
}
/* the subnfunc version */
void do_suspend_void(void)
void do_suspend_void(void)
{
if (ISSET(SUSPEND))
do_suspend(0);
......
......@@ -2920,6 +2920,11 @@ void do_spell(void)
char *temp = safe_tempfile(&temp_file);
const char *spell_msg;
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
if (temp == NULL) {
statusbar(_("Error writing temp file: %s"), strerror(errno));
return;
......
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