1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00

fix for the (z) flag: report partial word (like `"foo', without a closing quote); mention in manual that (z) is handled lately (11117)

This commit is contained in:
Sven Wischnowsky 2000-05-03 13:05:39 +00:00
parent cdbbb405de
commit 17e79c0157
3 changed files with 15 additions and 1 deletions

View file

@ -1,5 +1,9 @@
2000-05-03 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
* 11117: Doc/Zsh/expn.yo, Src/hist.c: fix for the (z) flag: report
partial word (like `"foo', without a closing quote); mention in
manual that (z) is handled lately
* Andrej: 11067: Completion/Builtins/_zcompile: handle -t option
* 11113: Doc/Zsh/expn.yo, Src/hist.c, Src/subst.c,

View file

@ -679,6 +679,11 @@ for `tt(ps:\n:)'.
item(tt(z))(
Split the result of the expansion into words using shell parsing to
find the words, i.e. taking into account any quoting in the value.
Note that this is done very lately, as for the `tt((s))' flag. So to
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(t))(
Use a string describing the type of the parameter where the value
@ -839,7 +844,7 @@ Note that the `tt((F))' flag implicitly supplies a string for joining in this
manner.
)
item(tt(8.) em(Forced Splitting))(
If one of the `tt((s))' or `tt((f))' flags are present, or the `tt(=)'
If one of the `tt((s))', `tt((f))' or `tt((z))' flags are present, or the `tt(=)'
specifier was present (e.g. tt(${=)var(var)tt(})), the word is split on
occurrences of the specified string, or (for tt(=) with neither of the two
flags present) any of the characters in tt($IFS).

View file

@ -2102,6 +2102,11 @@ bufferwords(LinkList list, char *buf, int *index)
cur = num - 1;
}
} while (tok != ENDINPUT && tok != LEXERR);
if (buf && tok == LEXERR && tokstr && *tokstr) {
untokenize((p = dupstring(tokstr)));
addlinknode(list, p);
num++;
}
if (cur < 0 && num)
cur = num - 1;
noaliases = 0;