mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0748: using sprintf() instead of semsg()
Problem: Using sprintf() instead of semsg(). Solution: Use semsg(). Fix bug with E888. (Ozaki Kiichi, closes #3801)
This commit is contained in:
31
src/regexp.c
31
src/regexp.c
@@ -338,6 +338,7 @@ toggle_Magic(int x)
|
|||||||
#define IEMSG_RET_NULL(m) return (iemsg((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 EMSG_RET_FAIL(m) return (emsg((m)), rc_did_emsg = TRUE, FAIL)
|
||||||
#define EMSG2_RET_NULL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, (void *)NULL)
|
#define EMSG2_RET_NULL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, (void *)NULL)
|
||||||
|
#define EMSG3_RET_NULL(m, c, a) return (semsg((const char *)(m), (c) ? "" : "\\", (a)), rc_did_emsg = TRUE, (void *)NULL)
|
||||||
#define EMSG2_RET_FAIL(m, c) return (semsg((const char *)(m), (c) ? "" : "\\"), rc_did_emsg = TRUE, FAIL)
|
#define EMSG2_RET_FAIL(m, c) return (semsg((const char *)(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 EMSG_ONE_RET_NULL EMSG2_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
|
||||||
|
|
||||||
@@ -1895,14 +1896,11 @@ regpiece(int *flagp)
|
|||||||
}
|
}
|
||||||
if (re_multi_type(peekchr()) != NOT_MULTI)
|
if (re_multi_type(peekchr()) != NOT_MULTI)
|
||||||
{
|
{
|
||||||
/* Can't have a multi follow a multi. */
|
// Can't have a multi follow a multi.
|
||||||
if (peekchr() == Magic('*'))
|
if (peekchr() == Magic('*'))
|
||||||
sprintf((char *)IObuff, _("E61: Nested %s*"),
|
EMSG2_RET_NULL(_("E61: Nested %s*"), reg_magic >= MAGIC_ON);
|
||||||
reg_magic >= MAGIC_ON ? "" : "\\");
|
EMSG3_RET_NULL(_("E62: Nested %s%c"), reg_magic == MAGIC_ALL,
|
||||||
else
|
no_Magic(peekchr()));
|
||||||
sprintf((char *)IObuff, _("E62: Nested %s%c"),
|
|
||||||
reg_magic == MAGIC_ALL ? "" : "\\", no_Magic(peekchr()));
|
|
||||||
EMSG_RET_NULL((char *)IObuff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2075,10 +2073,8 @@ regatom(int *flagp)
|
|||||||
case Magic('{'):
|
case Magic('{'):
|
||||||
case Magic('*'):
|
case Magic('*'):
|
||||||
c = no_Magic(c);
|
c = no_Magic(c);
|
||||||
sprintf((char *)IObuff, _("E64: %s%c follows nothing"),
|
EMSG3_RET_NULL(_("E64: %s%c follows nothing"),
|
||||||
(c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL)
|
(c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL), c);
|
||||||
? "" : "\\", c);
|
|
||||||
EMSG_RET_NULL((char *)IObuff);
|
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
|
|
||||||
case Magic('~'): /* previous substitute pattern */
|
case Magic('~'): /* previous substitute pattern */
|
||||||
@@ -3403,11 +3399,8 @@ read_limits(long *minval, long *maxval)
|
|||||||
if (*regparse == '\\')
|
if (*regparse == '\\')
|
||||||
regparse++; /* Allow either \{...} or \{...\} */
|
regparse++; /* Allow either \{...} or \{...\} */
|
||||||
if (*regparse != '}')
|
if (*regparse != '}')
|
||||||
{
|
EMSG2_RET_FAIL(_("E554: Syntax error in %s{...}"),
|
||||||
sprintf((char *)IObuff, _("E554: Syntax error in %s{...}"),
|
reg_magic == MAGIC_ALL);
|
||||||
reg_magic == MAGIC_ALL ? "" : "\\");
|
|
||||||
EMSG_RET_FAIL((char *)IObuff);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reverse the range if there was a '-', or make sure it is in the right
|
* Reverse the range if there was a '-', or make sure it is in the right
|
||||||
@@ -6998,7 +6991,11 @@ regprop(char_u *op)
|
|||||||
re_mult_next(char *what)
|
re_mult_next(char *what)
|
||||||
{
|
{
|
||||||
if (re_multi_type(peekchr()) == MULTI_MULT)
|
if (re_multi_type(peekchr()) == MULTI_MULT)
|
||||||
EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
|
{
|
||||||
|
semsg(_("E888: (NFA regexp) cannot repeat %s"), what);
|
||||||
|
rc_did_emsg = TRUE;
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -795,6 +795,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
748,
|
||||||
/**/
|
/**/
|
||||||
747,
|
747,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user