1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-04-30 05:45:16 +02:00

users/29160, workers/52156: Fix repetition of substitution modifier.

This commit is contained in:
Bart Schaefer 2023-09-16 20:51:27 -07:00
parent f72757ccf3
commit 1becbba0b6
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2023-09-16 Bart Schaefer <schaefer@zsh.org>
* 52156: Test/E01options.ztst: Test case for user/29160.
* users/29160: Src/subst.c: Fix repetition of substituion modifier.
* Christoffer Lundell: 52082: Functions/Zle/edit-command-line:
Enable linewise edit-command when in visual-line mode.

View File

@ -4689,7 +4689,8 @@ modify(char **str, char **ptr, int inbrace)
case 'S':
hsubpatopt = (c == 'S');
if (hsubl && hsubr)
subst(&copy, hsubl, hsubr, gbal, hsubpatopt);
subst(&copy, 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);

View File

@ -561,12 +561,14 @@
foo=(one.c two.c three.c)
print ${foo:s/#%(#b)t(*).c/T${match[1]}.X/}
print *(#q:s/#(#b)tmp(*e)/'scrunchy${match[1]}'/)
print ${${:-"left[({})]over"}:fs/(\\{\\}|\\(\\)|\\[\\])//}
unsetopt histsubstpattern
0:HIST_SUBST_PATTERN option
>TINGcd TINGfile1 TINGfile2 homedir
>THUMPcd THUMPfile1 THUMPfile2
>one.c Two.X Three.X
>homedir scrunchyfile1 scrunchyfile2 tmpcd
>leftover
setopt ignorebraces
echo X{a,b}Y