#983900 regexp.c: add information to an error message

Package:
src:nn
Source:
nn
Submitter:
Bjarni Ingi Gislason
Date:
2021-03-03 01:54:03 UTC
Severity:
normal
Tags:
#983900#5
Date:
2021-03-03 01:50:04 UTC
From:
To:
Dear Maintainer,

  Add the file name to an error message and sleep for 5 seconds to give
the user time to read it.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 regexp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/regexp.c b/regexp.c
index 7116b70..0a08534 100644
--- a/regexp.c
+++ b/regexp.c
@@ -209,6 +209,7 @@ STATIC int      strcspn(char *, char *);
 regexp         *
 regcomp(char *exp)
 {
+/* caller: action that uses this subroutine, is needed for error messages */
     register regexp *r;
     register char  *scan;
     register char  *longest;
@@ -1237,7 +1238,8 @@ strcspn(char *s1, char *s2)
 void
 regerror(char *s)
 {
+    msg("%s: regexp error: %s", __FILE__, s);
+    user_delay(5); /* Make messages readable */

-    msg("regexp: %s", s);
     /* NOTREACHED */
 }