commit 52d851a1aad884862a6b342d61ffef1e05e8aa26
parent 2d434f63e2a78c9675aa036ca371df492d5daad8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 4 Aug 2018 10:40:08 +0200
startup: don't overwrite rcfile error messages on a Linux console
On a Linux VT, refuse to start when there are errors in a nanorc file,
so that the messages no longer get overwritten -- which prevented the
user from seeing and reading them.
This fixes https://savannah.gnu.org/bugs/?54442.
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -1243,6 +1243,16 @@ void do_rcfiles(void)
check_vitals_mapped();
+#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
+
free(nanorc);
}