From 1becbba0b614c9ef17ba28aa51c4e8e7d21f1e0f Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 16 Sep 2023 20:51:27 -0700 Subject: users/29160, workers/52156: Fix repetition of substitution modifier. --- Src/subst.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/subst.c') diff --git a/Src/subst.c b/Src/subst.c index 52afd6484..dc2052ee0 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -4689,7 +4689,8 @@ modify(char **str, char **ptr, int inbrace) case 'S': hsubpatopt = (c == 'S'); if (hsubl && hsubr) - subst(©, hsubl, hsubr, gbal, hsubpatopt); + subst(©, dupstring(hsubl), dupstring(hsubr), + gbal, hsubpatopt); break; case 'q': copy = quotestring(copy, QT_BACKSLASH_SHOWNULL); @@ -4777,7 +4778,8 @@ modify(char **str, char **ptr, int inbrace) case 'S': hsubpatopt = (c == 'S'); if (hsubl && hsubr) - subst(str, hsubl, hsubr, gbal, hsubpatopt); + subst(str, dupstring(hsubl), dupstring(hsubr), + gbal, hsubpatopt); break; case 'q': *str = quotestring(*str, QT_BACKSLASH); -- cgit 1.4.1