From: Chris Allegretta Date: Sat, 12 Jan 2002 23:17:15 +0000 (+0000) Subject: - New configure option --disable-wrapping-as-root. Added because the 1.0 series... X-Git-Tag: v1.0.8~3 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=0d1e49a3a60ca962f36dc81bd4753447aad1f9bd;p=nano.git - New configure option --disable-wrapping-as-root. Added because the 1.0 series doesn't really allow wrapping disabled without a flag and debian's installer can't handle that git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_0_branch/nano@1000 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 818a4c9b..0b89f398 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ CVS Code - and nano.c:do_int_spell_fix() (Rocco Corsi). - Add Meta-A as alternate keyystroke for ^^ for people with non-US keyboards. + - New configure option --disable-wrapping-as-root. Added + because the 1.0 series doesn't really allow wrapping disabled + without a flag and debian's installer can't handle that. - global.c: shorcut_init() - Replace hard coded ALT_G and ALT_H values in the replace diff --git a/acconfig.h b/acconfig.h index 6cd9782b..2848b520 100644 --- a/acconfig.h +++ b/acconfig.h @@ -51,3 +51,6 @@ /* Define this to disable any and all text wrapping */ #undef DISABLE_WRAPPING +/* Define this to disable wrapping as root by default */ +#undef DISABLE_ROOTWRAP + diff --git a/configure.in b/configure.in index a56135dc..909791ae 100644 --- a/configure.in +++ b/configure.in @@ -68,6 +68,12 @@ AC_ARG_ENABLE(wrapping, AC_DEFINE(DISABLE_WRAPPING) fi]) +AC_ARG_ENABLE(wrapping-as-root, +[ --disable-wrapping-as-root Disables wrapping of text as root by default], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_ROOTWRAP) + fi]) + AC_MSG_CHECKING([whether to use slang]) CURSES_LIB_NAME="" AC_ARG_WITH(slang, diff --git a/nano.c b/nano.c index bb2e0f11..46954b6f 100644 --- a/nano.c +++ b/nano.c @@ -479,6 +479,9 @@ void version(void) #ifdef DISABLE_WRAPPING printf(" --disable-wrapping"); #endif +#ifdef DISABLE_ROOTWRAP + printf(" --disable-wrapping-as-root"); +#endif #ifdef USE_SLANG printf(" --with-slang"); #endif @@ -2463,6 +2466,10 @@ int main(int argc, char *argv[]) filename = mallocstrcpy(filename, argv[optind]); } +#ifdef DISABLE_ROOTWRAP + if (geteuid() == 0) + SET(NO_WRAP); +#endif /* First back up the old settings so they can be restored, duh */ tcgetattr(0, &oldterm);