nano

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

commit eb5968f845c88d8e801618045b1bcc092a655604
parent f2c72bf7599d93cd254c72d165debbf3c57360ac
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Thu, 17 Nov 2016 18:05:09 +0100

startup: activate restricted mode earlier, so --help will reflect it

Kind-of-discovered-by: Markus Bergholz <markuman@gmail.com>

Diffstat:
Msrc/nano.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -2081,6 +2081,10 @@ int main(int argc, char **argv) SET(NO_WRAP); #endif + /* If the executable's name starts with 'r', activate restricted mode. */ + if (*(tail(argv[0])) == 'r') + SET(RESTRICTED); + while ((optchr = #ifdef HAVE_GETOPT_LONG getopt_long(argc, argv, @@ -2298,11 +2302,6 @@ int main(int argc, char **argv) } } - /* If the executable filename starts with 'r', enable restricted - * mode. */ - if (*(tail(argv[0])) == 'r') - SET(RESTRICTED); - /* If we're using restricted mode, disable suspending, backups, * rcfiles, and history files, since they all would allow reading * from or writing to files not specified on the command line. */