mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-29 16:13:27 +03:00
build: eradicate the --disable-wrapping-as-root configure option
Hard-wrapping is disabled by default for any user, so this special configure option is no longer needed.
This commit is contained in:
parent
946755a307
commit
2482cfca56
@ -298,12 +298,6 @@ if test "x$enable_wrapping" != xno; then
|
||||
AC_DEFINE(ENABLE_WRAPPING, 1, [Define this to have hard text wrapping.])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(wrapping-as-root,
|
||||
AS_HELP_STRING([--disable-wrapping-as-root], [Disable wrapping of text as root by default]))
|
||||
if test "x$enable_wrapping_as_root" = xno; then
|
||||
AC_DEFINE(DISABLE_ROOTWRAPPING, 1, [Define this to disable text wrapping as root by default.])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
AS_HELP_STRING([--enable-debug], [Enable debugging (disabled by default)]))
|
||||
if test "x$enable_debug" = xyes; then
|
||||
|
@ -1683,10 +1683,6 @@ chances are you only want this feature when you're working on the nano source.
|
||||
Disables Native Language support. This will disable the use of any
|
||||
available GNU @command{nano} translations.
|
||||
|
||||
@item --disable-wrapping-as-root
|
||||
Disable hard-wrapping of overlong lines by default when @command{nano}
|
||||
is run as root.
|
||||
|
||||
@item --enable-utf8
|
||||
Enable support for reading and writing Unicode files. This will require
|
||||
either a wide version of curses, or a UTF-8-enabled version of Slang.
|
||||
|
19
src/nano.c
19
src/nano.c
@ -1016,9 +1016,6 @@ void version(void)
|
||||
#endif
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
#ifdef DISABLE_ROOTWRAPPING
|
||||
printf(" --disable-wrapping-as-root");
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
printf(" --enable-debug");
|
||||
#endif
|
||||
@ -2071,13 +2068,6 @@ int main(int argc, char **argv)
|
||||
" -- please report a bug\n", (int)MB_CUR_MAX);
|
||||
#endif
|
||||
|
||||
#if !defined(ENABLE_NANORC) && defined(DISABLE_ROOTWRAPPING)
|
||||
/* If we don't have rcfile support, --disable-wrapping-as-root is
|
||||
* used, and we're root, turn wrapping off. */
|
||||
if (geteuid() == NANO_ROOT_UID)
|
||||
SET(NO_WRAP);
|
||||
#endif
|
||||
|
||||
/* Set sensible defaults, different from what Pico does. */
|
||||
SET(NO_WRAP);
|
||||
SET(NO_NEWLINES);
|
||||
@ -2398,17 +2388,10 @@ int main(int argc, char **argv)
|
||||
for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++)
|
||||
flags[i] |= flags_cmdline[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 */
|
||||
|
||||
#ifdef ENABLE_WRAPPING
|
||||
/* Override a "set nowrap" in an rcfile (or a --disable-wrapping-as-root)
|
||||
* if --fill was given on the command line and not undone by --nowrap. */
|
||||
/* A --fill on the command line overrides a "set nowrap" in an rcfile. */
|
||||
if (forced_wrapping)
|
||||
UNSET(NO_WRAP);
|
||||
#endif
|
||||
|
@ -1225,13 +1225,6 @@ void do_rcfiles(void)
|
||||
nanorc = mallocstrcpy(nanorc, SYSCONFDIR "/nanorc");
|
||||
parse_one_nanorc();
|
||||
|
||||
/* When configured with --disable-wrapping-as-root, turn wrapping off
|
||||
* for root, so that only root's .nanorc or --fill can turn it on. */
|
||||
#ifdef DISABLE_ROOTWRAPPING
|
||||
if (geteuid() == NANO_ROOT_UID)
|
||||
SET(NO_WRAP);
|
||||
#endif
|
||||
|
||||
get_homedir();
|
||||
xdgconfdir = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user