about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Doc/Zsh/expn.yo7
-rw-r--r--Src/hist.c5
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6030303a6..9a7757b7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index e9e3b95c9..c0e525067 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -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).
diff --git a/Src/hist.c b/Src/hist.c
index 3dde19845..e869e3a2e 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -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;