change redisplay to handle some cases where the line consumes more than the number of physical screen lines; add regerror() error messages if regular expression compilation fails; make sure active region readline variables are displayed with bind -v; partial fix for bind -x and commands containing quoting characters

This commit is contained in:
Chet Ramey
2023-07-19 15:33:45 -04:00
parent 7f7ee0e9c6
commit ad39c5c3d7
23 changed files with 2269 additions and 1996 deletions
+11 -2
View File
@@ -3975,6 +3975,8 @@ execute_cond_node (COND_COM *cond)
#if defined (COND_REGEXP)
if (rmatch)
{
char *errstr;
mflags = SHMAT_PWARN;
#if defined (ARRAY_VARS)
mflags |= SHMAT_SUBEXP;
@@ -3988,9 +3990,16 @@ execute_cond_node (COND_COM *cond)
free(t2);
#endif
result = sh_regmatch (arg1, arg2, mflags);
errstr = NULL;
result = sh_regmatch (arg1, arg2, mflags, &errstr);
if (result == 2)
builtin_error (_("invalid regular expression `%s'"), arg2);
{
if (errstr && *errstr)
builtin_error (_("invalid regular expression `%s': %s"), arg2, errstr);
else
builtin_error (_("invalid regular expression `%s'"), arg2);
free (errstr);
}
}
else
#endif /* COND_REGEXP */