commit d054044d30f7c9043ed7d397ccaa0c834b2499f1
parent 9dc72cf3baf6749eb529b0504ce2a8d248c47100
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 1 Nov 2017 20:33:14 +0100
tweaks: transform the token DISABLE_EXTRA to ENABLE_EXTRA
Diffstat:
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -112,8 +112,13 @@ fi
AC_ARG_ENABLE(extra,
AS_HELP_STRING([--disable-extra], [Disable the Easter egg]))
-if test "x$enable_extra" = xno; then
- AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.])
+if test "x$enable_tiny" = xyes; then
+ if test "x$enable_extra" != xyes; then
+ enable_extra=no
+ fi
+fi
+if test "x$enable_extra" != xno; then
+ AC_DEFINE(ENABLE_EXTRA, 1, [Define this to have an Easter egg.])
fi
AC_ARG_ENABLE(help,
@@ -284,9 +289,6 @@ AC_ARG_ENABLE(tiny,
AS_HELP_STRING([--enable-tiny], [Disable features for the sake of size]))
if test "x$enable_tiny" = xyes; then
AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.])
- if test "x$enable_extra" != xyes; then
- AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.])
- fi
if test "x$enable_libmagic" != xyes; then
enable_libmagic=no
fi
diff --git a/src/files.c b/src/files.c
@@ -2030,7 +2030,7 @@ int do_writeout(bool exiting, bool withprompt)
/* The filename we offer, or what the user typed so far. */
bool maychange = (openfile->filename[0] == '\0');
/* Whether it's okay to save the file under a different name. */
-#ifndef DISABLE_EXTRA
+#ifdef ENABLE_EXTRA
static bool did_credits = FALSE;
#endif
@@ -2139,7 +2139,7 @@ int do_writeout(bool exiting, bool withprompt)
continue;
}
-#ifndef DISABLE_EXTRA
+#ifdef ENABLE_EXTRA
/* If the current file has been modified, we've pressed
* Ctrl-X at the edit window to exit, we've pressed "y" at
* the "Save modified buffer" prompt to save, we've entered
diff --git a/src/nano.c b/src/nano.c
@@ -933,7 +933,7 @@ void version(void)
#ifdef ENABLE_COLOR
printf(" --enable-color");
#endif
-#ifndef DISABLE_EXTRA
+#ifdef ENABLE_EXTRA
printf(" --enable-extra");
#endif
#ifdef ENABLE_HELP
@@ -982,7 +982,7 @@ void version(void)
#ifndef ENABLE_COMMENT
printf(" --disable-comment");
#endif
-#ifdef DISABLE_EXTRA
+#ifndef ENABLE_EXTRA
printf(" --disable-extra");
#endif
#ifndef ENABLE_HELP
diff --git a/src/proto.h b/src/proto.h
@@ -691,7 +691,7 @@ void spotlight_softwrapped(bool active, size_t from_col, size_t to_col);
void do_suspend_void(void);
void disable_waiting(void);
void enable_waiting(void);
-#ifndef DISABLE_EXTRA
+#ifdef ENABLE_EXTRA
void do_credits(void);
#endif
diff --git a/src/winio.c b/src/winio.c
@@ -3563,7 +3563,7 @@ void spotlight_softwrapped(bool active, size_t from_col, size_t to_col)
}
#endif
-#ifndef DISABLE_EXTRA
+#ifdef ENABLE_EXTRA
#define CREDIT_LEN 54
#define XLCREDIT_LEN 9
@@ -3712,4 +3712,4 @@ void do_credits(void)
total_refresh();
}
-#endif /* !DISABLE_EXTRA */
+#endif /* ENABLE_EXTRA */