summaryrefslogtreecommitdiffstats
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-05 16:54:08 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-05 16:54:08 +0200
commit966e58e413ffa88af8d748e697aa2999571fcd7b (patch)
tree4f62a3029956f9d677337e1fb5ce698260aa739d /src/regexp.c
parentc5e2b040b490c2f4dd50c945840bc176bfcccb29 (diff)
patch 8.0.0623: error for invalid regexp is not very informativev8.0.0623
Problem: The message "Invalid range" is used for multiple errors. Solution: Add two more specific error messages. (Itchyny, Ken Hamada)
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/regexp.c b/src/regexp.c
index e1f6484c00..de066a1015 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -358,6 +358,8 @@ static char_u *regprop(char_u *);
static int re_mult_next(char *what);
static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
+static char_u e_reverse_range[] = N_("E944: Reverse range in character class");
+static char_u e_large_class[] = N_("E945: Range too large in character class");
static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)");
@@ -2426,14 +2428,14 @@ collection:
endc = coll_get_char();
if (startc > endc)
- EMSG_RET_NULL(_(e_invrange));
+ EMSG_RET_NULL(_(e_reverse_range));
#ifdef FEAT_MBYTE
if (has_mbyte && ((*mb_char2len)(startc) > 1
|| (*mb_char2len)(endc) > 1))
{
- /* Limit to a range of 256 chars */
+ /* Limit to a range of 256 chars. */
if (endc > startc + 256)
- EMSG_RET_NULL(_(e_invrange));
+ EMSG_RET_NULL(_(e_large_class));
while (++startc <= endc)
regmbc(startc);
}