Commit 6f6ee844 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Ehm, no, cancel that. That makes it act like

a command-line option, overriding any nanorc.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4743 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 86f4384b
Showing with 9 additions and 6 deletions
+9 -6
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
* src/{proto.h,files.c,global.c,nano.c,rcfile.c}: Drop the obsolete * src/{proto.h,files.c,global.c,nano.c,rcfile.c}: Drop the obsolete
argument of shortcut_init(), and remove two unneeded calls of it. argument of shortcut_init(), and remove two unneeded calls of it.
* src/global.c (shortcut_init): Allow M-J after an --enable-justify. * src/global.c (shortcut_init): Allow M-J after an --enable-justify.
* src/nano.c (main): No matter whether nanorc support was disabled
or not, or the rcfile should be ignored or not, when we're root and
--disable-wrapping-as-root was used, switch wrapping off.
2014-04-06 Benno Schulenberg <bensberg@justemail.net> 2014-04-06 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init): Limit M-T (cut-till-end-of-file) to * src/global.c (shortcut_init): Limit M-T (cut-till-end-of-file) to
......
...@@ -2184,9 +2184,9 @@ int main(int argc, char **argv) ...@@ -2184,9 +2184,9 @@ int main(int argc, char **argv)
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif
#ifdef DISABLE_ROOTWRAPPING #if !defined(ENABLE_NANORC) && defined(DISABLE_ROOTWRAPPING)
/* If --disable-wrapping-as-root was used, /* If we don't have rcfile support, --disable-wrapping-as-root is
* and we're root, turn wrapping off. */ * used, and we're root, turn wrapping off. */
if (geteuid() == NANO_ROOT_UID) if (geteuid() == NANO_ROOT_UID)
SET(NO_WRAP); SET(NO_WRAP);
#endif #endif
...@@ -2487,6 +2487,12 @@ int main(int argc, char **argv) ...@@ -2487,6 +2487,12 @@ int main(int argc, char **argv)
for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++)
flags[i] |= flags_cpy[i]; flags[i] |= flags_cpy[i];
} }
#ifdef DISABLE_ROOTWRAPPING
/* If we don't have any rcfiles, --disable-wrapping-as-root is used,
* and we're root, turn wrapping off. */
else if (geteuid() == NANO_ROOT_UID)
SET(NO_WRAP);
#endif
#endif /* ENABLE_NANORC */ #endif /* ENABLE_NANORC */
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
......
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