diff options
author | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-09-12 03:12:32 +0000 |
---|---|---|
committer | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-09-12 03:12:32 +0000 |
commit | 485cb95acef1b2dbddfc962c13691dd0c0b44d28 (patch) | |
tree | 640af7bc74ba41d626c44c8ed7d4d2b6298e4579 | |
parent | a35e75ea9260e18e32dd587ed9c1efd8c952d9d3 (diff) | |
download | zsh-485cb95acef1b2dbddfc962c13691dd0c0b44d28.tar.gz zsh-485cb95acef1b2dbddfc962c13691dd0c0b44d28.tar.xz zsh-485cb95acef1b2dbddfc962c13691dd0c0b44d28.zip |
Merge of 2237[56]: ${(0)...} splits on null bytes.
-rw-r--r-- | Doc/Zsh/expn.yo | 4 | ||||
-rw-r--r-- | Src/subst.c | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 7e35cd13e..a22296c84 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -817,6 +817,10 @@ access single words in the result, one has to use nested expansions as in `tt(${${(z)foo}[2]})'. Likewise, to remove the quotes in the resulting words one would do: `tt(${(Q)${(z)foo}})'. ) +item(tt(0))( +Split the result of the expansion on null bytes. This is a shorthand +for `tt(ps:\0:)'. +) enditem() The following flags (except tt(p)) are followed by one or more arguments diff --git a/Src/subst.c b/Src/subst.c index 67de61418..f67a745d8 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1232,6 +1232,13 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) sep = "\n"; break; + case '0': + spsep = zhalloc(3); + spsep[0] = Meta; + spsep[1] = '\0' ^ 32; + spsep[2] = '\0'; + break; + case 's': tt = 1; /* fall through */ |