about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-12-13 21:56:18 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-12-13 21:56:18 +0000
commit724f55afdaa501b7039bbcf7cb20aacc28e9022f (patch)
tree1fbd4b1000c3096f1ed8ff93c64d6747754ab8f2
parent7a598440f601e6cf27a38f3151a416dbcfd5b978 (diff)
downloadzsh-724f55afdaa501b7039bbcf7cb20aacc28e9022f.tar.gz
zsh-724f55afdaa501b7039bbcf7cb20aacc28e9022f.tar.xz
zsh-724f55afdaa501b7039bbcf7cb20aacc28e9022f.zip
24240: make vared check for trailing garbage earlier
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_main.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d01a0e0d..34cd5a827 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-12-13  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* 24240: Src/Zle/zle_main.c: vared didnʼt check for trailing
+	garbage on parameter names until too late.
+
 	* 24239: Completion/Zsh/Context/_subscript: if the [ of
 	a subscript was backslashed, a trailing space was added
 	backslashed along with the "\[".
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index a45e63617..2817f9249 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1441,6 +1441,10 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func))
 	zwarnnam(name, "no such variable: %s", args[0]);
 	return 1;
     } else if (v) {
+	if (*s) {
+	    zwarnnam(name, "not an identifier: `%s'", args[0]);
+	    return 1;
+	}
 	if (v->isarr) {
 	    /* Array: check for separators and quote them. */
 	    char **arr = getarrvalue(v), **aptr, **tmparr, **tptr;