forked from aniani/vim
patch 8.0.0074
Problem: Cannot make Vim fail on an internal error. Solution: Add IEMSG() and IEMSG2(). (Domenique Pelle) Avoid reporting an internal error without mentioning where.
This commit is contained in:
@@ -335,11 +335,13 @@ toggle_Magic(int x)
|
||||
/* Used for an error (down from) vim_regcomp(): give the error message, set
|
||||
* rc_did_emsg and return NULL */
|
||||
#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, (void *)NULL)
|
||||
#define IEMSG_RET_NULL(m) return (IEMSG(m), rc_did_emsg = TRUE, (void *)NULL)
|
||||
#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
|
||||
#define EMSG2_RET_NULL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, (void *)NULL)
|
||||
#define EMSG2_RET_FAIL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, FAIL)
|
||||
#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
|
||||
|
||||
|
||||
#define MAX_LIMIT (32767L << 16L)
|
||||
|
||||
static int re_multi_type(int);
|
||||
@@ -2043,7 +2045,7 @@ regatom(int *flagp)
|
||||
case Magic(')'):
|
||||
if (one_exactly)
|
||||
EMSG_ONE_RET_NULL;
|
||||
EMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
|
||||
IEMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
|
||||
/* NOTREACHED */
|
||||
|
||||
case Magic('='):
|
||||
@@ -5070,7 +5072,7 @@ regmatch(
|
||||
}
|
||||
else
|
||||
{
|
||||
EMSG(_(e_internal)); /* Shouldn't happen */
|
||||
internal_error("BRACE_LIMITS");
|
||||
status = RA_FAIL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user