bash-5.2-alpha release

This commit is contained in:
Chet Ramey
2022-01-20 15:06:05 -05:00
parent 9439ce094c
commit 4491c03014
409 changed files with 63493 additions and 54853 deletions
+11 -4
View File
@@ -178,17 +178,22 @@ strsub (string, pat, rep, global)
}
/* Replace all instances of C in STRING with TEXT. TEXT may be empty or
NULL. If DO_GLOB is non-zero, we quote the replacement text for
globbing. Backslash may be used to quote C. */
NULL. If (FLAGS & 1) is non-zero, we quote the replacement text for
globbing. Backslash may be used to quote C. If (FLAGS & 2) we allow
backslash to escape backslash as well. */
char *
strcreplace (string, c, text, do_glob)
strcreplace (string, c, text, flags)
char *string;
int c;
const char *text;
int do_glob;
int flags;
{
char *ret, *p, *r, *t;
int len, rlen, ind, tlen;
int do_glob, escape_backslash;
do_glob = flags & 1;
escape_backslash = flags & 2;
len = STRLEN (text);
rlen = len + strlen (string) + 2;
@@ -225,6 +230,8 @@ strcreplace (string, c, text, do_glob)
if (*p == '\\' && p[1] == c)
p++;
else if (escape_backslash && *p == '\\' && p[1] == '\\')
p++;
ind = r - ret;
RESIZE_MALLOCED_BUFFER (ret, ind, 2, rlen, rlen);