Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] sh: tilde expansion after field splitting
- X-seq: zsh-workers 41830
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [bug] sh: tilde expansion after field splitting
- Date: Sun, 8 Oct 2017 13:45:14 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=rZhbsSljIJce6b60JpX1MnxHQjB+FOSgz5kTIqavTkI=; b=Y8fG2/8fu40H6SPXxJOhFYn2yKd5f3dVIVVa+9KyckEEL3aR7cBrzVLKc1IMpvO4tx Yh+y2YxrlF93HiLGdy1XhX80N1t1V27MCep9V5V3OLV30ADxoYvVhbB+8pPebz2Q+Mz3 i0E0F2vdta1GQ0Iv+vnwMm5vWJxN4fmZjOMtBFXjpNO5QZgxMivdpexFt+NvDTzx+nPB tmcHVoW5VS4/apEl67j5FfZ75CGnJ0AfzA6ZA6Y5KqtZfSBy6IqYiAgpIsIfVjZIbKEG bsUhlmfMRRRDfUQR/ZGTGhA/yLD/d/AFn41eI/dXaZ8txzPcRoF5pv6U+a7KxH9xee6D 74Vw==
- In-reply-to: <20171008202032.11ea7bf9@ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <06fb6a91-6766-bbd7-9543-cbafe704ee59@inlv.org> <171008005347.ZM1177@torch.brasslantern.com> <20171008202032.11ea7bf9@ntlworld.com>
On Oct 8, 8:20pm, Peter Stephenson wrote:
}
} Good, it sounds like the effect of the chunk you previous identified as
} related was simply moving the linked list node on as a side effect, or
} something like that.
Yes, prior to that previous chunk when stringsubst() did a shwordsplit
the newly created nodes were not properly linked into the original list
of arguments, which is why e.g. mapping history modifiers over the args
didn't work correctly. Adding them to the list fixed that, but caused
all but the first to be examined twice for SHFILEEXPANSION.
} > - There either isn't a Test/ for the keyvalpairelement() case in the
} > first hunk below, or it isn't rigorous enough, because I initially
} > forgot the incnode(node) in that hunk, yet the shell did *not* go
} > into an infinite loop during "make check", nor did any test
} > fail
}
} That doesn't make sense.
I don't know what to tell you; I just now commented it back out and tried
again, and it still works. I suspect what's happening is that after the
first call to keyvalpairelement() node = insnode is done, and then we
continue around the loop and call keyvalpairelement() a second time on
the same node, at which point it fails and we fall through the rest of
the loop and hit the incnode() at the end, which fixes things.
} > - Grepping Test/* doesn't find anything for SH_FILE_EXPANSION (in
} > upper/lower, with/without underscores, etc.). Did I miss it?
} > Does the test for the case in this thread belong in D04parameter
} > or E01options?
}
} Assuming SH_FILE_EXPANSION predates the test suite, I wouldn't be
} surprised if it's missing.
I looked at E01options and found a test there. It's not quite enough,
obviously, so here's a new one.
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 8101ff5..6929f51 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -1026,6 +1026,18 @@
>$lspath $lspath =
>$lspath
+ () {
+ emulate -L sh
+ v='~/one ~/two'
+ print -l -- $v $v
+ }
+0:SH_FILE_EXPANSION option with GLOB_SUBST et al.
+F:Regression test for workers/41811
+>~/one
+>~/two
+>~/one
+>~/two
+
testpat() {
if [[ $1 = ${~2} ]]; then print $1 $2 yes; else print $1 $2 no; fi
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author