zsh-workers
 help / color / Atom feed
* [PATCH] Fix workers/45164: ${(S)%%} will now consider the empty string as a potential match.
@ 2020-01-01 14:07 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2020-01-01 14:07 UTC (permalink / raw)
  To: zsh-workers

---
 Src/glob.c             | 4 ++--
 Test/D04parameter.ztst | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Src/glob.c b/Src/glob.c
index ca5846704..f67a376b9 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -3059,7 +3059,7 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr,
 	case (SUB_END|SUB_SUBSTR):
 	case (SUB_END|SUB_LONG|SUB_SUBSTR):
 	    /* Longest/shortest at end, matching substrings.       */
-	    if (!(fl & SUB_LONG)) {
+	    {
 		set_pat_start(p, l);
 		if (pattrylen(p, send, 0, 0, &patstralloc, umltot) &&
 		    !--n) {
@@ -3397,7 +3397,7 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr,
 	case (SUB_END|SUB_SUBSTR):
 	case (SUB_END|SUB_LONG|SUB_SUBSTR):
 	    /* Longest/shortest at end, matching substrings.       */
-	    if (!(fl & SUB_LONG)) {
+	    {
 		set_pat_start(p, l);
 		if (pattrylen(p, send, 0, 0, &patstralloc, uml) && !--n) {
 		    *sp = get_match_ret(&imd, uml, uml);
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index f4af5d59c..83ac7ebf4 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -2639,7 +2639,7 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888
 
  foo=pws
  print 2: ${(S)foo%%*}
--f:(S) with zero-length matches at end, part 1 (workers/45164)
+0:(S) with zero-length matches at end, part 1 (workers/45164)
 >2: pws
 
  foo=pws

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-01 14:07 [PATCH] Fix workers/45164: ${(S)%%} will now consider the empty string as a potential match Daniel Shahaf

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git