return p;
}
+ static int
+check_regexp_delim(int c)
+{
+ if (isalpha(c))
+ {
+ emsg(_("E146: Regular expressions can't be delimited by letters"));
+ return FAIL;
+ }
+ return OK;
+}
+
/*
* Perform a substitution from line eap->line1 to line eap->line2 using the
* command pointed to by eap->arg which should be of the form:
&& vim_strchr((char_u *)"0123456789cegriIp|\"", *cmd) == NULL)
{
// don't accept alphanumeric for separator
- if (isalpha(*cmd))
- {
- emsg(_("E146: Regular expressions can't be delimited by letters"));
+ if (check_regexp_delim(*cmd) == FAIL)
return;
- }
+
/*
* undocumented vi feature:
* "\/sub/" and "\?sub?" use last used search pattern (almost like
emsg(_("E148: Regular expression missing from global"));
return;
}
+ else if (check_regexp_delim(*cmd) == FAIL)
+ {
+ return;
+ }
else
{
delim = *cmd; // get the delimiter