Hello, all. In GRUB everything runs in the same environment and so
abort() can only be mapped to complete bootloader termination. It's
unreasonable to do such an action in case of regexp error. Can we do
something like following:
=== modified file 'grub-core/gnulib/regcomp.c'
--- grub-core/gnulib/regcomp.c    2012-03-26 00:45:46 +0000
+++ grub-core/gnulib/regcomp.c    2012-03-26 01:27:04 +0000
@@ -549,13 +549,19 @@ regerror (int errcode, const regex_t *_R
   if (BE (errcode < 0
       || errcode >= (int) (sizeof (__re_error_msgid_idx)
                    / sizeof (__re_error_msgid_idx[0])), 0))
-    /* Only error codes returned by the rest of the code should be passed
-       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]);
+    {
+#ifdef HAVE_ABORT
+      /* Only error codes returned by the rest of the code should be passed
+     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 ();
+#else
+      msg = gettext ("unknown regexp error");
+#endif
+    }
+  else
+    msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
 
   msg_size = strlen (msg) + 1; /* Includes the null.  */
 
@@ -1151,7 +1157,10 @@ optimize_utf8 (re_dfa_t *dfa)
     }
     break;
       default:
+#ifdef HAVE_ABORT
     abort ();
+#endif
+    break;
       }
 
   if (mb_chars || has_period)


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to