[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH 1/2] startup: don't ask the user to press Enter upon
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] [PATCH 1/2] startup: don't ask the user to press Enter upon an rcfile error |
Date: |
Wed, 25 Oct 2017 19:50:58 +0200 |
The user told nano to start, thus nano should *start*, without
pausing and without nagging the user.
---
src/rcfile.c | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/rcfile.c b/src/rcfile.c
index 2988d4fc..ac2f3cda 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -122,10 +122,8 @@ static const rcoption rcopts[] = {
{NULL, 0}
};
-static bool errors = FALSE;
- /* Whether we got any errors while parsing an rcfile. */
static size_t lineno = 0;
- /* If we did, the line number where the last error occurred. */
+ /* The line number of the last encountered error. */
static char *nanorc = NULL;
/* The path to the rcfile we're parsing. */
#ifndef DISABLE_COLOR
@@ -138,9 +136,7 @@ static colortype *lastcolor = NULL;
/* The end of the color list for the current syntax. */
#endif
-/* We have an error in some part of the rcfile. Print the error message
- * on stderr, and then make the user hit Enter to continue starting
- * nano. */
+/* Report an error in an rcfile, printing it to stderr. */
void rcfile_error(const char *msg, ...)
{
va_list ap;
@@ -148,11 +144,8 @@ void rcfile_error(const char *msg, ...)
if (ISSET(QUIET))
return;
- fprintf(stderr, "\n");
- if (lineno > 0) {
- errors = TRUE;
+ if (lineno > 0)
fprintf(stderr, _("Error in %s on line %lu: "), nanorc, (unsigned
long)lineno);
- }
va_start(ap, msg);
vfprintf(stderr, _(msg), ap);
@@ -1249,13 +1242,6 @@ void do_rcfiles(void)
check_vitals_mapped();
free(nanorc);
-
- if (errors && !ISSET(QUIET) && !ISSET(NO_PAUSES)) {
- errors = FALSE;
- fprintf(stderr, _("\nPress Enter to continue starting nano.\n"));
- while (getchar() != '\n')
- ;
- }
}
#endif /* ENABLE_NANORC */
--
2.14.1
- [Nano-devel] [PATCH 1/2] startup: don't ask the user to press Enter upon an rcfile error,
Benno Schulenberg <=