bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 06/11] Make gnulib's regcomp not abort()


From: Robbie Harwood
Subject: [PATCH 06/11] Make gnulib's regcomp not abort()
Date: Mon, 25 Oct 2021 17:55:39 -0400

From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>

[rharwood@redhat.com: we wrote a commit message]
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
 lib/regcomp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/regcomp.c b/lib/regcomp.c
index 887e5b506..4a106ff59 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -528,9 +528,9 @@ regerror (int errcode, const regex_t *__restrict preg, char 
*__restrict errbuf,
        to this routine.  If we are given anything else, or if other regex
        code generates an invalid error code, then the program has a bug.
        Dump core so we can fix it.  */
-    abort ();
-
-  msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
+    msg = gettext ("unknown regexp error");
+  else
+    msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
 
   msg_size = strlen (msg) + 1; /* Includes the null.  */
 
@@ -1136,7 +1136,7 @@ optimize_utf8 (re_dfa_t *dfa)
        }
        break;
       default:
-       abort ();
+       break;
       }
 
   if (mb_chars || has_period)
-- 
2.33.0




reply via email to

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