zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Correct isident false positive.
@ 2011-01-16 12:05 Ricky Zhou
  2011-01-16 19:43 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Ricky Zhou @ 2011-01-16 12:05 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

I'm not familiar with with the precise definition of an identifier, so
somebody might want to double-check that this change (which assumes that
valid identifiers cannot start with a '[') is correct.  This fixes the
following crash:

printf %n '[0]'

---
 Src/params.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Src/params.c b/Src/params.c
index 8510b92..ba6cd63 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1009,6 +1009,8 @@ isident(char *s)
      * definitely not a valid identifier.         */
     if (!*ss)
 	return 1;
+    if (s == ss)
+	return 0;
     if (*ss != '[')
 	return 0;
 
-- 
1.7.3.4


[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-16 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-16 12:05 [PATCH] Correct isident false positive Ricky Zhou
2011-01-16 19:43 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).