[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/10] Make gnulib's regcomp not abort()
From: |
Robbie Harwood |
Subject: |
[PATCH v2 05/10] Make gnulib's regcomp not abort() |
Date: |
Wed, 1 Dec 2021 16:02:00 -0500 |
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 6a97fdee4..a8cefebf1 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -506,9 +506,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. */
@@ -1099,7 +1099,7 @@ optimize_utf8 (re_dfa_t *dfa)
}
break;
default:
- abort ();
+ break;
}
if (mb_chars || has_period)
--
2.33.0
- Re: [PATCH v2 01/10] argp-parse.c (__argp_input): Don't crash if pstate is NULL, (continued)
[PATCH v2 05/10] Make gnulib's regcomp not abort(),
Robbie Harwood <=
[PATCH v2 06/10] Make CFLAGS less painful, Robbie Harwood, 2021/12/01
[PATCH v2 07/10] Fix __argp_fmtstream_point()'s return type and comparisons with it, Robbie Harwood, 2021/12/01
[PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints, Robbie Harwood, 2021/12/01