nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] startup: don't overwrite rcfile error messages on a


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] startup: don't overwrite rcfile error messages on a Linux console
Date: Sat, 4 Aug 2018 10:48:17 +0200

This fixes https://savannah.gnu.org/bugs/?54442.
---
 src/nano.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/nano.c b/src/nano.c
index fe156ec8..33c44199 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2419,6 +2419,16 @@ int main(int argc, char **argv)
        else if (geteuid() == NANO_ROOT_UID)
                SET(NO_WRAP);
 #endif
+
+#ifdef __linux__
+       /* On a Linux console, don't start nano when there are rcfile errors,
+        * because otherwise these error messages get wiped. */
+       if (on_a_vt && rcfile_with_errors) {
+               fprintf(stderr, _("If needed, use nano with the -I option "
+                                                       "to adjust your nanorc 
settings.\n"));
+               exit(1);
+       }
+#endif
 #endif /* ENABLE_NANORC */
 
 #ifdef ENABLE_WRAPPING
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]