about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2023-02-06 14:16:17 +0000
committerPeter Stephenson <p.stephenson@samsung.com>2023-02-06 14:16:17 +0000
commitd6b027c3c1203da5f3c6451bd6e2e0b81bd766b6 (patch)
tree253121684572803fca6cca5c21fb503f50df98ed /Src/subst.c
parentbffdbccda69683ce857dfad457e3209c0f00aa0c (diff)
downloadzsh-d6b027c3c1203da5f3c6451bd6e2e0b81bd766b6.tar.gz
zsh-d6b027c3c1203da5f3c6451bd6e2e0b81bd766b6.tar.xz
zsh-d6b027c3c1203da5f3c6451bd6e2e0b81bd766b6.zip
51350: ${(S)...//#%...} didn't match the whole string
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 4ad9fee1a..3dd920e87 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -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