mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-12-28 16:15:02 +01:00
51350: ${(S)...//#%...} didn't match the whole string
This commit is contained in:
parent
bffdbccda6
commit
d6b027c3c1
3 changed files with 15 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2023-02-06 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 51350: Src/subst.c, Test/D04parameter.ztst: the combination
|
||||
${(S)...//#%...} needs to match as far as possible.
|
||||
|
||||
2023-02-02 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 51354: Doc/Zsh/params.yo: Fix markup in man page version
|
||||
|
|
|
@ -2926,6 +2926,9 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
|
|||
*/
|
||||
if (!(flags & (SUB_MATCH|SUB_REST|SUB_BIND|SUB_EIND|SUB_LEN)))
|
||||
flags |= SUB_REST;
|
||||
/* If matching at start and end, don't stop early */
|
||||
if ((flags & (SUB_START|SUB_END)) == (SUB_START|SUB_END))
|
||||
flags |= SUB_LONG;
|
||||
|
||||
/*
|
||||
* With ":" treat a value as unset if the variable is set but
|
||||
|
|
|
@ -2307,6 +2307,13 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888
|
|||
>x
|
||||
>y
|
||||
|
||||
a="string"
|
||||
print ${(S)a//#%((#b)(*))/different}
|
||||
print $match[1]
|
||||
0:Fully anchored string must be fully searched
|
||||
>different
|
||||
>string
|
||||
|
||||
my_width=6
|
||||
my_index=1
|
||||
my_options=Option1
|
||||
|
|
Loading…
Reference in a new issue