Commit d893fa94 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

add restricted mode, per IO ERROR's patch

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1723 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 233 additions and 99 deletions
+233 -99
...@@ -9,14 +9,42 @@ CVS code - ...@@ -9,14 +9,42 @@ CVS code -
- Add better explanations for and in the "Terminal breakage" - Add better explanations for and in the "Terminal breakage"
comments, and handle missing key #ifdefs inside the functions comments, and handle missing key #ifdefs inside the functions
that use those keys. (DLR) that use those keys. (DLR)
- Add restricted mode, accessible via the -Z/--restricted
command line option or by invoking nano with any name
beginning with 'r' (e.g. "rnano"). In restricted mode, nano
will not read or write to any file not specified on the
command line, read any nanorc files, allow suspending, or
allow a file to be appended to, prepended to, or saved under a
different name if it already has one. (IO ERROR) DLR: Also
disable backup files and spell checking (since the latter can
leave a pre-spell-checked version of the file in a temporary
directory), use tail() to get the program name so that the
check for its beginning with 'r' will work when a path is
specified, disable toggles that are only useful with options
that are disabled in restricted mode, call nano_disabled_msg()
when trying to read or spell check a file instead of leaving
the shortcuts out of the main list, and instead of acting as
though TEMP_OPT is enabled when exiting with a modified file
(which caused problems if the filename was blank), only allow
a filename to be modified at the writeout prompt if it's blank
beforehand. Changes to do_writeout(), toggle_init(),
shortcut_init(), die_save_file(), and nanogetstr().
- Call nano_disabled_msg() directly from the shortcut list
instead of inside the disabled functions. (David Benbennick)
- files.c: - files.c:
add_open_file() add_open_file()
- Rearrange the NANO_SMALL #ifdef so that the code to set the - Rearrange the NANO_SMALL #ifdef so that the code to set the
MODIFIED flag in open_files->flags is included only once. MODIFIED flag in open_files->flags is included only once.
(DLR) (DLR)
do_writeout()
- Refactor so that no recursion is needed if we try to exit with
a modified file that has no name when TEMP_OPT is set. (DLR)
- nano.c: - nano.c:
do_delete() do_delete()
- Tweak for efficiency. (David Benbennick) - Tweak for efficiency. (David Benbennick)
do_exit()
- Refactor so that no recursion is needed if we try to exit with
a modified file that has no name when TEMP_OPT is set. (DLR)
print_numlock_warning() print_numlock_warning()
- Removed, as it's no longer needed and was never called - Removed, as it's no longer needed and was never called
anywhere after the input overhaul. (DLR) anywhere after the input overhaul. (DLR)
...@@ -72,9 +100,14 @@ CVS code - ...@@ -72,9 +100,14 @@ CVS code -
- Use napms() instead of nanosleep(), as it does the same thing - Use napms() instead of nanosleep(), as it does the same thing
(aside from taking an argument in milliseconds instead of (aside from taking an argument in milliseconds instead of
microseconds) and curses includes it. (DLR) microseconds) and curses includes it. (DLR)
- nano.1:
- Document restricted mode. (IO ERROR) DLR: Add minor
modifications to account for the above changes.
- nano.texi: - nano.texi:
- Fix inaccuracies: Meta-L now toggles line wrapping, and Meta-< - Fix inaccuracies: Meta-L now toggles line wrapping, and Meta-<
and Meta-> aren't toggles. (DLR) and Meta-> aren't toggles. (DLR)
- Document restricted mode. (IO ERROR) DLR: Add minor
modifications to account for the above changes.
- faq.html: - faq.html:
- Removed question about the NumLock glitch, as it's no longer - Removed question about the NumLock glitch, as it's no longer
needed. (DLR) needed. (DLR)
......
...@@ -92,6 +92,13 @@ Specify a specific syntax highlighting from the ...@@ -92,6 +92,13 @@ Specify a specific syntax highlighting from the
.I .nanorc .I .nanorc
to use, if available. to use, if available.
.TP .TP
.B \-Z (\-\-restricted)
Restricted mode: Don't read or write to any file not specified on the
command line, read any nanorc files, allow suspending, or allow a file
to be appended to, prepended to, or saved under a different name if it
already has one. Also accessible by invoking \fBnano\fP with any name
beginning with 'r' (e.g. "rnano").
.TP
.B \-c (\-\-const) .B \-c (\-\-const)
Constantly show the cursor position. Constantly show the cursor position.
.TP .TP
......
...@@ -157,6 +157,13 @@ Print the version number and copyright and quit. ...@@ -157,6 +157,13 @@ Print the version number and copyright and quit.
Specify a specific syntax highlighting from the .nanorc to use, if Specify a specific syntax highlighting from the .nanorc to use, if
available. available.
@item -Z, --restricted
Restricted mode: Don't read or write to any file not specified on the
command line, read any nanorc files, allow suspending, or allow a file
to be appended to, prepended to, or saved under a different name if it
already has one. Also accessible by invoking @code{nano} with any name
beginning with 'r' (e.g. "rnano").
@item -c, --const @item -c, --const
Constantly display the cursor position and line number on the statusbar. Constantly display the cursor position and line number on the statusbar.
......
...@@ -1808,9 +1808,7 @@ int do_writeout(int exiting) ...@@ -1808,9 +1808,7 @@ int do_writeout(int exiting)
currshortcut = writefile_list; currshortcut = writefile_list;
#endif #endif
if (exiting && ISSET(TEMP_OPT)) { if (exiting && filename[0] != '\0' && ISSET(TEMP_OPT)) {
i = -1;
if (filename[0] != '\0') {
i = write_file(filename, FALSE, 0, FALSE); i = write_file(filename, FALSE, 0, FALSE);
if (i == 1) { if (i == 1) {
/* Write succeeded. */ /* Write succeeded. */
...@@ -1819,16 +1817,6 @@ int do_writeout(int exiting) ...@@ -1819,16 +1817,6 @@ int do_writeout(int exiting)
} }
} }
/* No filename or the write above failed. */
if (i == -1) {
UNSET(TEMP_OPT);
do_exit();
/* They cancelled; abort quit. */
return -1;
}
}
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (ISSET(MARK_ISSET) && !exiting) if (ISSET(MARK_ISSET) && !exiting)
answer = mallocstrcpy(answer, ""); answer = mallocstrcpy(answer, "");
...@@ -1941,9 +1929,9 @@ int do_writeout(int exiting) ...@@ -1941,9 +1929,9 @@ int do_writeout(int exiting)
i = do_yesno(FALSE, _("File exists, OVERWRITE ?")); i = do_yesno(FALSE, _("File exists, OVERWRITE ?"));
if (i == 0 || i == -1) if (i == 0 || i == -1)
continue; continue;
} else if (filename[0] != '\0' } else if (!ISSET(RESTRICTED) && filename[0] != '\0'
#ifndef NANO_SMALL #ifndef NANO_SMALL
&& (!ISSET(MARK_ISSET) || exiting) && (exiting || !ISSET(MARK_ISSET))
#endif #endif
) { ) {
i = do_yesno(FALSE, _("Save file under DIFFERENT NAME ?")); i = do_yesno(FALSE, _("Save file under DIFFERENT NAME ?"));
...@@ -1955,7 +1943,7 @@ int do_writeout(int exiting) ...@@ -1955,7 +1943,7 @@ int do_writeout(int exiting)
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* Here's where we allow the selected text to be written to /* Here's where we allow the selected text to be written to
* a separate file. */ * a separate file. */
if (ISSET(MARK_ISSET) && !exiting) if (!ISSET(RESTRICTED) && !exiting && ISSET(MARK_ISSET))
i = write_marked(answer, FALSE, append, FALSE); i = write_marked(answer, FALSE, append, FALSE);
else else
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
...@@ -2432,7 +2420,6 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list) ...@@ -2432,7 +2420,6 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
} }
#endif /* !DISABLE_TABCOMP */ #endif /* !DISABLE_TABCOMP */
#if !defined(DISABLE_BROWSER) || !defined(NANO_SMALL)
/* Only print the last part of a path; isn't there a shell /* Only print the last part of a path; isn't there a shell
* command for this? */ * command for this? */
const char *tail(const char *foo) const char *tail(const char *foo)
...@@ -2447,7 +2434,6 @@ const char *tail(const char *foo) ...@@ -2447,7 +2434,6 @@ const char *tail(const char *foo)
return tmp; return tmp;
} }
#endif
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
/* Our sort routine for file listings -- sort directories before /* Our sort routine for file listings -- sort directories before
......
...@@ -275,6 +275,7 @@ void toggle_init(void) ...@@ -275,6 +275,7 @@ void toggle_init(void)
toggle_init_one(TOGGLE_NOHELP_KEY, toggle_nohelp_msg, NO_HELP); toggle_init_one(TOGGLE_NOHELP_KEY, toggle_nohelp_msg, NO_HELP);
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_MULTIBUFFER_KEY, toggle_multibuffer_msg, MULTIBUFFER); toggle_init_one(TOGGLE_MULTIBUFFER_KEY, toggle_multibuffer_msg, MULTIBUFFER);
#endif #endif
toggle_init_one(TOGGLE_CONST_KEY, toggle_const_msg, CONSTUPDATE); toggle_init_one(TOGGLE_CONST_KEY, toggle_const_msg, CONSTUPDATE);
...@@ -283,14 +284,17 @@ void toggle_init(void) ...@@ -283,14 +284,17 @@ void toggle_init(void)
toggle_init_one(TOGGLE_WRAP_KEY, toggle_wrap_msg, NO_WRAP); toggle_init_one(TOGGLE_WRAP_KEY, toggle_wrap_msg, NO_WRAP);
#endif #endif
toggle_init_one(TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg, CUT_TO_END); toggle_init_one(TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg, CUT_TO_END);
if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_SUSPEND_KEY, toggle_suspend_msg, SUSPEND); toggle_init_one(TOGGLE_SUSPEND_KEY, toggle_suspend_msg, SUSPEND);
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
toggle_init_one(TOGGLE_MOUSE_KEY, toggle_mouse_msg, USE_MOUSE); toggle_init_one(TOGGLE_MOUSE_KEY, toggle_mouse_msg, USE_MOUSE);
#endif #endif
if (!ISSET(RESTRICTED)) {
toggle_init_one(TOGGLE_NOCONVERT_KEY, toggle_noconvert_msg, NO_CONVERT); toggle_init_one(TOGGLE_NOCONVERT_KEY, toggle_noconvert_msg, NO_CONVERT);
toggle_init_one(TOGGLE_DOS_KEY, toggle_dos_msg, DOS_FILE); toggle_init_one(TOGGLE_DOS_KEY, toggle_dos_msg, DOS_FILE);
toggle_init_one(TOGGLE_MAC_KEY, toggle_mac_msg, MAC_FILE); toggle_init_one(TOGGLE_MAC_KEY, toggle_mac_msg, MAC_FILE);
toggle_init_one(TOGGLE_BACKUP_KEY, toggle_backup_msg, BACKUP_FILE); toggle_init_one(TOGGLE_BACKUP_KEY, toggle_backup_msg, BACKUP_FILE);
}
toggle_init_one(TOGGLE_SMOOTH_KEY, toggle_smooth_msg, SMOOTHSCROLL); toggle_init_one(TOGGLE_SMOOTH_KEY, toggle_smooth_msg, SMOOTHSCROLL);
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
toggle_init_one(TOGGLE_SYNTAX_KEY, toggle_syntax_msg, COLOR_SYNTAX); toggle_init_one(TOGGLE_SYNTAX_KEY, toggle_syntax_msg, COLOR_SYNTAX);
...@@ -437,7 +441,13 @@ void shortcut_init(int unjustify) ...@@ -437,7 +441,13 @@ void shortcut_init(int unjustify)
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&main_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
if (open_files != NULL && (open_files->prev != NULL || open_files->next != NULL)) if (open_files != NULL && (open_files->prev != NULL || open_files->next != NULL))
...@@ -461,7 +471,13 @@ void shortcut_init(int unjustify) ...@@ -461,7 +471,13 @@ void shortcut_init(int unjustify)
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"), sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
IFHELP(nano_justify_msg, NANO_NO_KEY), IFHELP(nano_justify_msg, NANO_NO_KEY),
NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW, do_justify); NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW,
#ifndef NANO_SMALL
do_justify
#else
nano_disabled_msg
#endif
);
/* this is so we can view multiple files */ /* this is so we can view multiple files */
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
...@@ -473,7 +489,7 @@ void shortcut_init(int unjustify) ...@@ -473,7 +489,7 @@ void shortcut_init(int unjustify)
#else #else
NOVIEW NOVIEW
#endif #endif
, do_insertfile_void); , !ISSET(RESTRICTED) ? do_insertfile_void : nano_disabled_msg);
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_WHEREIS_KEY, _("Where Is"), sc_init_one(&main_list, NANO_WHEREIS_KEY, _("Where Is"),
...@@ -514,7 +530,11 @@ void shortcut_init(int unjustify) ...@@ -514,7 +530,11 @@ void shortcut_init(int unjustify)
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_SPELL_KEY, _("To Spell"), sc_init_one(&main_list, NANO_SPELL_KEY, _("To Spell"),
IFHELP(nano_spell_msg, NANO_NO_KEY), NANO_SPELL_FKEY, IFHELP(nano_spell_msg, NANO_NO_KEY), NANO_SPELL_FKEY,
NANO_NO_KEY, NOVIEW, do_spell); NANO_NO_KEY, NOVIEW,
#ifndef DISABLE_SPELLER
!ISSET(RESTRICTED) ? do_spell :
#endif
nano_disabled_msg);
sc_init_one(&main_list, NANO_GOTO_KEY, _("Go To Line"), sc_init_one(&main_list, NANO_GOTO_KEY, _("Go To Line"),
IFHELP(nano_goto_msg, NANO_ALT_GOTO_KEY), NANO_GOTO_FKEY, IFHELP(nano_goto_msg, NANO_ALT_GOTO_KEY), NANO_GOTO_FKEY,
...@@ -554,7 +574,13 @@ void shortcut_init(int unjustify) ...@@ -554,7 +574,13 @@ void shortcut_init(int unjustify)
sc_init_one(&main_list, NANO_MARK_KEY, _("Mark Text"), sc_init_one(&main_list, NANO_MARK_KEY, _("Mark Text"),
IFHELP(nano_mark_msg, NANO_ALT_MARK_KEY), IFHELP(nano_mark_msg, NANO_ALT_MARK_KEY),
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_mark); NANO_NO_KEY, NANO_NO_KEY, NOVIEW,
#ifndef NANO_SMALL
do_mark
#else
nano_disabled_msg
#endif
);
sc_init_one(&main_list, NANO_DELETE_KEY, _("Delete"), sc_init_one(&main_list, NANO_DELETE_KEY, _("Delete"),
IFHELP(nano_delete_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_delete_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -610,7 +636,13 @@ void shortcut_init(int unjustify) ...@@ -610,7 +636,13 @@ void shortcut_init(int unjustify)
sc_init_one(&whereis_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&whereis_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&whereis_list, NANO_CANCEL_KEY, _("Cancel"),
...@@ -680,7 +712,13 @@ void shortcut_init(int unjustify) ...@@ -680,7 +712,13 @@ void shortcut_init(int unjustify)
sc_init_one(&replace_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&replace_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&replace_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&replace_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -727,7 +765,13 @@ void shortcut_init(int unjustify) ...@@ -727,7 +765,13 @@ void shortcut_init(int unjustify)
sc_init_one(&replace_list_2, NANO_HELP_KEY, _("Get Help"), sc_init_one(&replace_list_2, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&replace_list_2, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&replace_list_2, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -751,7 +795,13 @@ void shortcut_init(int unjustify) ...@@ -751,7 +795,13 @@ void shortcut_init(int unjustify)
sc_init_one(&goto_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&goto_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&goto_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&goto_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -785,10 +835,17 @@ void shortcut_init(int unjustify) ...@@ -785,10 +835,17 @@ void shortcut_init(int unjustify)
sc_init_one(&writefile_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&writefile_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
/* Translators: try to keep this string under 16 characters long */ /* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_TOFILES_KEY, _("To Files"), sc_init_one(&writefile_list, NANO_TOFILES_KEY, _("To Files"),
IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
...@@ -796,28 +853,33 @@ void shortcut_init(int unjustify) ...@@ -796,28 +853,33 @@ void shortcut_init(int unjustify)
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* Translators: try to keep this string under 16 characters long */ /* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_NO_KEY, _("DOS Format"), sc_init_one(&writefile_list, NANO_NO_KEY, _("DOS Format"),
IFHELP(nano_dos_msg, TOGGLE_DOS_KEY), NANO_NO_KEY, IFHELP(nano_dos_msg, TOGGLE_DOS_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
/* Translators: try to keep this string under 16 characters long */ /* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_NO_KEY, _("Mac Format"), sc_init_one(&writefile_list, NANO_NO_KEY, _("Mac Format"),
IFHELP(nano_mac_msg, TOGGLE_MAC_KEY), NANO_NO_KEY, IFHELP(nano_mac_msg, TOGGLE_MAC_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
#endif #endif
/* Translators: try to keep this string under 16 characters long */ /* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_NO_KEY, _("Append"), sc_init_one(&writefile_list, NANO_NO_KEY, _("Append"),
IFHELP(nano_append_msg, NANO_APPEND_KEY), NANO_NO_KEY, IFHELP(nano_append_msg, NANO_APPEND_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
/* Translators: try to keep this string under 16 characters long */ /* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_NO_KEY, _("Prepend"), sc_init_one(&writefile_list, NANO_NO_KEY, _("Prepend"),
IFHELP(nano_prepend_msg, NANO_PREPEND_KEY), NANO_NO_KEY, IFHELP(nano_prepend_msg, NANO_PREPEND_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* Translators: try to keep this string under 16 characters long */ /* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_NO_KEY, _("Backup File"), sc_init_one(&writefile_list, NANO_NO_KEY, _("Backup File"),
IFHELP(nano_backup_msg, TOGGLE_BACKUP_KEY), NANO_NO_KEY, IFHELP(nano_backup_msg, TOGGLE_BACKUP_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
...@@ -831,13 +893,20 @@ void shortcut_init(int unjustify) ...@@ -831,13 +893,20 @@ void shortcut_init(int unjustify)
sc_init_one(&insertfile_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&insertfile_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&insertfile_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&insertfile_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, 0); NANO_NO_KEY, VIEW, 0);
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
if (!ISSET(RESTRICTED))
sc_init_one(&insertfile_list, NANO_TOFILES_KEY, _("To Files"), sc_init_one(&insertfile_list, NANO_TOFILES_KEY, _("To Files"),
IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
...@@ -845,12 +914,14 @@ void shortcut_init(int unjustify) ...@@ -845,12 +914,14 @@ void shortcut_init(int unjustify)
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* Translators: try to keep this string under 22 characters long */ /* Translators: try to keep this string under 22 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, _("Execute Command"), sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, _("Execute Command"),
IFHELP(nano_execute_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_execute_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
/* Translators: try to keep this string under 22 characters long */ /* Translators: try to keep this string under 22 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&insertfile_list, NANO_NO_KEY, _("New Buffer"), sc_init_one(&insertfile_list, NANO_NO_KEY, _("New Buffer"),
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0); NANO_NO_KEY, NOVIEW, 0);
...@@ -862,7 +933,13 @@ void shortcut_init(int unjustify) ...@@ -862,7 +933,13 @@ void shortcut_init(int unjustify)
sc_init_one(&spell_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&spell_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&spell_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&spell_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -874,7 +951,13 @@ void shortcut_init(int unjustify) ...@@ -874,7 +951,13 @@ void shortcut_init(int unjustify)
sc_init_one(&extcmd_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&extcmd_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&extcmd_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -886,7 +969,13 @@ void shortcut_init(int unjustify) ...@@ -886,7 +969,13 @@ void shortcut_init(int unjustify)
sc_init_one(&browser_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&browser_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&browser_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&browser_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
...@@ -909,7 +998,13 @@ void shortcut_init(int unjustify) ...@@ -909,7 +998,13 @@ void shortcut_init(int unjustify)
sc_init_one(&gotodir_list, NANO_HELP_KEY, _("Get Help"), sc_init_one(&gotodir_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW, do_help); NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
do_help
#else
nano_disabled_msg
#endif
);
sc_init_one(&gotodir_list, NANO_CANCEL_KEY, _("Cancel"), sc_init_one(&gotodir_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
......
...@@ -151,6 +151,10 @@ void die_save_file(const char *die_filename) ...@@ -151,6 +151,10 @@ void die_save_file(const char *die_filename)
char *ret; char *ret;
int i = -1; int i = -1;
/* No emergency files in restricted mode! */
if (ISSET(RESTRICTED))
return;
/* If we can't save, we have REAL bad problems, but we might as well /* If we can't save, we have REAL bad problems, but we might as well
TRY. */ TRY. */
if (die_filename[0] == '\0') if (die_filename[0] == '\0')
...@@ -656,6 +660,7 @@ void usage(void) ...@@ -656,6 +660,7 @@ void usage(void)
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
print1opt(_("-Y [str]"), _("--syntax [str]"), _("Syntax definition to use")); print1opt(_("-Y [str]"), _("--syntax [str]"), _("Syntax definition to use"));
#endif #endif
print1opt(_("-Z"), _("--restricted"), _("Restricted mode"));
print1opt("-c", "--const", _("Constantly show cursor position")); print1opt("-c", "--const", _("Constantly show cursor position"));
#ifndef NANO_SMALL #ifndef NANO_SMALL
print1opt("-d", "--rebinddelete", _("Fix Backspace/Delete confusion problem")); print1opt("-d", "--rebinddelete", _("Fix Backspace/Delete confusion problem"));
...@@ -765,12 +770,11 @@ int no_help(void) ...@@ -765,12 +770,11 @@ int no_help(void)
return ISSET(NO_HELP) ? 2 : 0; return ISSET(NO_HELP) ? 2 : 0;
} }
#if defined(DISABLE_JUSTIFY) || defined(DISABLE_SPELLER) || defined(DISABLE_HELP) || defined(NANO_SMALL) int nano_disabled_msg(void)
void nano_disabled_msg(void)
{ {
statusbar(_("Sorry, support for this function has been disabled")); statusbar(_("Sorry, support for this function has been disabled"));
return 1;
} }
#endif
#ifndef NANO_SMALL #ifndef NANO_SMALL
static int pid; /* This is the PID of the newly forked process static int pid; /* This is the PID of the newly forked process
...@@ -1231,13 +1235,9 @@ int do_prev_word(void) ...@@ -1231,13 +1235,9 @@ int do_prev_word(void)
return 0; return 0;
} }
#endif /* !NANO_SMALL */
int do_mark(void) int do_mark(void)
{ {
#ifdef NANO_SMALL
nano_disabled_msg();
#else
TOGGLE(MARK_ISSET); TOGGLE(MARK_ISSET);
if (ISSET(MARK_ISSET)) { if (ISSET(MARK_ISSET)) {
statusbar(_("Mark Set")); statusbar(_("Mark Set"));
...@@ -1247,9 +1247,9 @@ int do_mark(void) ...@@ -1247,9 +1247,9 @@ int do_mark(void)
statusbar(_("Mark UNset")); statusbar(_("Mark UNset"));
edit_refresh(); edit_refresh();
} }
#endif
return 1; return 1;
} }
#endif /* !NANO_SMALL */
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
void wrap_reset(void) void wrap_reset(void)
...@@ -1829,14 +1829,9 @@ char *do_alt_speller(char *tempfile_name) ...@@ -1829,14 +1829,9 @@ char *do_alt_speller(char *tempfile_name)
return NULL; return NULL;
} }
#endif
int do_spell(void) int do_spell(void)
{ {
#ifdef DISABLE_SPELLER
nano_disabled_msg();
return 1;
#else
int i; int i;
char *temp, *spell_msg; char *temp, *spell_msg;
...@@ -1879,8 +1874,8 @@ int do_spell(void) ...@@ -1879,8 +1874,8 @@ int do_spell(void)
statusbar(_("Finished checking spelling")); statusbar(_("Finished checking spelling"));
return 1; return 1;
#endif
} }
#endif /* !DISABLE_SPELLER */
#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY) #if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
/* The "indentation" of a line is the white-space between the quote part /* The "indentation" of a line is the white-space between the quote part
...@@ -2404,15 +2399,10 @@ int do_para_end(void) ...@@ -2404,15 +2399,10 @@ int do_para_end(void)
{ {
return do_para_search(2, NULL, NULL, NULL, TRUE); return do_para_search(2, NULL, NULL, NULL, TRUE);
} }
#endif
/* Justify a paragraph. */ /* Justify a paragraph. */
int do_justify(void) int do_justify(void)
{ {
#ifdef DISABLE_JUSTIFY
nano_disabled_msg();
return 1;
#else
size_t quote_len; size_t quote_len;
/* Length of the initial quotation of the paragraph we /* Length of the initial quotation of the paragraph we
* justify. */ * justify. */
...@@ -2706,8 +2696,8 @@ int do_justify(void) ...@@ -2706,8 +2696,8 @@ int do_justify(void)
display_main_list(); display_main_list();
return 0; return 0;
#endif /* !DISABLE_JUSTIFY */
} }
#endif /* !DISABLE_JUSTIFY */
int do_exit(void) int do_exit(void)
{ {
...@@ -3088,6 +3078,7 @@ int main(int argc, char *argv[]) ...@@ -3088,6 +3078,7 @@ int main(int argc, char *argv[])
{"mac", 0, 0, 'M'}, {"mac", 0, 0, 'M'},
{"noconvert", 0, 0, 'N'}, {"noconvert", 0, 0, 'N'},
{"smooth", 0, 0, 'S'}, {"smooth", 0, 0, 'S'},
{"restricted", 0, 0, 'Z'},
{"autoindent", 0, 0, 'i'}, {"autoindent", 0, 0, 'i'},
{"cut", 0, 0, 'k'}, {"cut", 0, 0, 'k'},
#endif #endif
...@@ -3109,11 +3100,11 @@ int main(int argc, char *argv[]) ...@@ -3109,11 +3100,11 @@ int main(int argc, char *argv[])
#endif #endif
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
while ((optchr = getopt_long(argc, argv, "h?BDE:FHIMNQ:RST:VY:abcdefgijklmo:pr:s:tvwxz", while ((optchr = getopt_long(argc, argv, "h?BDE:FHIMNQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz",
long_options, NULL)) != -1) { long_options, NULL)) != -1) {
#else #else
while ((optchr = while ((optchr =
getopt(argc, argv, "h?BDE:FHIMNQ:RST:VY:abcdefgijklmo:pr:s:tvwxz")) != -1) { getopt(argc, argv, "h?BDE:FHIMNQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz")) != -1) {
#endif #endif
switch (optchr) { switch (optchr) {
...@@ -3201,6 +3192,9 @@ int main(int argc, char *argv[]) ...@@ -3201,6 +3192,9 @@ int main(int argc, char *argv[])
syntaxstr = mallocstrcpy(syntaxstr, optarg); syntaxstr = mallocstrcpy(syntaxstr, optarg);
break; break;
#endif #endif
case 'Z':
SET(RESTRICTED);
break;
case 'c': case 'c':
SET(CONSTUPDATE); SET(CONSTUPDATE);
break; break;
...@@ -3275,6 +3269,18 @@ int main(int argc, char *argv[]) ...@@ -3275,6 +3269,18 @@ int main(int argc, char *argv[])
} }
} }
/* If filename starts with 'r', we use restricted mode. */
if (*(tail(argv[0])) == 'r')
SET(RESTRICTED);
/* If we're using restricted mode, disable suspending, backup files,
* and reading rcfiles. */
if (ISSET(RESTRICTED)) {
UNSET(SUSPEND);
UNSET(BACKUP_FILE);
SET(NO_RCFILE);
}
/* We've read through the command line options. Now back up the flags /* We've read through the command line options. Now back up the flags
and values that are set, and read the rcfile(s). If the values and values that are set, and read the rcfile(s). If the values
haven't changed afterward, restore the backed-up values. */ haven't changed afterward, restore the backed-up values. */
......
...@@ -268,6 +268,7 @@ typedef struct historyheadtype { ...@@ -268,6 +268,7 @@ typedef struct historyheadtype {
#define PRESERVE (1<<27) #define PRESERVE (1<<27)
#define HISTORY_CHANGED (1<<28) #define HISTORY_CHANGED (1<<28)
#define HISTORYLOG (1<<29) #define HISTORYLOG (1<<29)
#define RESTRICTED (1<<30)
/* Control key sequences, changing these would be very very bad. */ /* Control key sequences, changing these would be very very bad. */
#define NANO_CONTROL_SPACE 0 #define NANO_CONTROL_SPACE 0
......
...@@ -199,9 +199,7 @@ char **username_tab_completion(char *buf, int *num_matches); ...@@ -199,9 +199,7 @@ char **username_tab_completion(char *buf, int *num_matches);
char **cwd_tab_completion(char *buf, int *num_matches); char **cwd_tab_completion(char *buf, int *num_matches);
char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list); char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list);
#endif #endif
#if !defined(DISABLE_BROWSER) || !defined(NANO_SMALL)
const char *tail(const char *foo); const char *tail(const char *foo);
#endif
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
int diralphasort(const void *va, const void *vb); int diralphasort(const void *va, const void *vb);
void free_charptrarray(char **array, int len); void free_charptrarray(char **array, int len);
...@@ -272,9 +270,7 @@ void usage(void); ...@@ -272,9 +270,7 @@ void usage(void);
void version(void); void version(void);
void do_early_abort(void); void do_early_abort(void);
int no_help(void); int no_help(void);
#if defined(DISABLE_JUSTIFY) || defined(DISABLE_SPELLER) || defined(DISABLE_HELP) || defined(NANO_SMALL) int nano_disabled_msg(void);
void nano_disabled_msg(void);
#endif
#ifndef NANO_SMALL #ifndef NANO_SMALL
RETSIGTYPE cancel_fork(int signal); RETSIGTYPE cancel_fork(int signal);
int open_pipe(const char *command); int open_pipe(const char *command);
...@@ -291,8 +287,8 @@ int do_enter(void); ...@@ -291,8 +287,8 @@ int do_enter(void);
#ifndef NANO_SMALL #ifndef NANO_SMALL
int do_next_word(void); int do_next_word(void);
int do_prev_word(void); int do_prev_word(void);
#endif
int do_mark(void); int do_mark(void);
#endif
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
void wrap_reset(void); void wrap_reset(void);
int do_wrap(filestruct *inptr); int do_wrap(filestruct *inptr);
...@@ -301,8 +297,8 @@ int do_wrap(filestruct *inptr); ...@@ -301,8 +297,8 @@ int do_wrap(filestruct *inptr);
int do_int_spell_fix(const char *word); int do_int_spell_fix(const char *word);
char *do_int_speller(char *tempfile_name); char *do_int_speller(char *tempfile_name);
char *do_alt_speller(char *tempfile_name); char *do_alt_speller(char *tempfile_name);
#endif
int do_spell(void); int do_spell(void);
#endif
#if !defined(DISABLE_WRAPPING) && !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY) #if !defined(DISABLE_WRAPPING) && !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
size_t indent_length(const char *line); size_t indent_length(const char *line);
#endif #endif
...@@ -330,8 +326,8 @@ int do_para_search(int search_type, size_t *quote, size_t *par, size_t ...@@ -330,8 +326,8 @@ int do_para_search(int search_type, size_t *quote, size_t *par, size_t
*indent, int do_refresh); *indent, int do_refresh);
int do_para_begin(void); int do_para_begin(void);
int do_para_end(void); int do_para_end(void);
#endif /* !DISABLE_JUSTIFY */
int do_justify(void); int do_justify(void);
#endif /* !DISABLE_JUSTIFY */
int do_exit(void); int do_exit(void);
void signal_init(void); void signal_init(void);
RETSIGTYPE handle_hupterm(int signal); RETSIGTYPE handle_hupterm(int signal);
......
...@@ -1311,23 +1311,29 @@ int nanogetstr(int allowtabs, const char *buf, const char *def, ...@@ -1311,23 +1311,29 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
x++; x++;
break; break;
case NANO_DELETE_KEY: case NANO_DELETE_KEY:
if (!ISSET(RESTRICTED) || filename[0] == '\0' || s != writefile_list) {
if (x < xend) { if (x < xend) {
charmove(answer + x, answer + x + 1, xend - x); charmove(answer + x, answer + x + 1, xend - x);
xend--; xend--;
} }
}
break; break;
case NANO_CUT_KEY: case NANO_CUT_KEY:
case NANO_UNCUT_KEY: case NANO_UNCUT_KEY:
if (!ISSET(RESTRICTED) || filename[0] == '\0' || s != writefile_list) {
null_at(&answer, 0); null_at(&answer, 0);
xend = 0; xend = 0;
x = 0; x = 0;
}
break; break;
case NANO_BACKSPACE_KEY: case NANO_BACKSPACE_KEY:
if (!ISSET(RESTRICTED) || filename[0] == '\0' || s != writefile_list) {
if (x > 0) { if (x > 0) {
charmove(answer + x - 1, answer + x, xend - x + 1); charmove(answer + x - 1, answer + x, xend - x + 1);
x--; x--;
xend--; xend--;
} }
}
break; break;
case NANO_TAB_KEY: case NANO_TAB_KEY:
#ifndef NANO_SMALL #ifndef NANO_SMALL
...@@ -1465,7 +1471,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def, ...@@ -1465,7 +1471,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
return kbinput; return kbinput;
} }
if (is_cntrl_char(kbinput)) if (is_cntrl_char(kbinput) || (ISSET(RESTRICTED) && filename[0] != '\0' && s == writefile_list))
break; break;
answer = charealloc(answer, xend + 2); answer = charealloc(answer, xend + 2);
charmove(answer + x + 1, answer + x, xend - x + 1); charmove(answer + x + 1, answer + x, xend - x + 1);
...@@ -2471,11 +2477,11 @@ int line_len(const char *ptr) ...@@ -2471,11 +2477,11 @@ int line_len(const char *ptr)
return j; return j;
} }
#ifndef DISABLE_HELP
/* Our shortcut-list-compliant help function, which is better than /* Our shortcut-list-compliant help function, which is better than
* nothing, and dynamic! */ * nothing, and dynamic! */
int do_help(void) int do_help(void)
{ {
#ifndef DISABLE_HELP
int i, page = 0, kbinput = ERR, meta_key, no_more = 0; int i, page = 0, kbinput = ERR, meta_key, no_more = 0;
int no_help_flag = 0; int no_help_flag = 0;
const shortcut *oldshortcut; const shortcut *oldshortcut;
...@@ -2572,12 +2578,9 @@ int do_help(void) ...@@ -2572,12 +2578,9 @@ int do_help(void)
free(help_text); free(help_text);
help_text = NULL; help_text = NULL;
#elif defined(DISABLE_HELP)
nano_disabled_msg();
#endif
return 1; return 1;
} }
#endif /* !DISABLE_HELP */
/* Highlight the current word being replaced or spell checked. We /* Highlight the current word being replaced or spell checked. We
* expect word to have tabs and control characters expanded. */ * expect word to have tabs and control characters expanded. */
......
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