Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Infinite loop with "hash ="
- X-seq: zsh-workers 38630
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Infinite loop with "hash ="
- Date: Tue, 7 Jun 2016 10:03:29 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=peNKTyvUIFD335nsRaP6xs4MBfEeRweNYIBpstr2tA0=; b=ELA+keAW3AUuarPmaOcq2v5aUnFN3FtlecOwWdci6FAWRJl4Pl4zZL4Pq6f69eAqlD tod5+QhjhPko7ri7udRbyv81cz0CRTEFu3Enyzvg8xH15aGtuxATkq9q9IDsa/y1tDZF NIKuFcY/p/YbDAHzlh2tmxYR0GhxtTE3iyaepFqDdRqu8yd1t8rT+eY8gnndlELJdsIx wAHrklNHAP7k6eoMB88Ckw6Jod4JdsbVnKHfm8OSrtF2fDco4LLBN2X2FgH6w2jSD6ek MSNXfBIdO3+msZCciZk/NW4fCdzgXGkp0ZVWwAKsqHmQRNph/msrt0+tRj9YgF62GoZJ 0aDA==
- In-reply-to: <87fusprngk.fsf@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <87fusprngk.fsf@gmail.com>
On Jun 7, 6:08pm, Christian Neukirchen wrote:
}
} Running "hash =" will trigger an infinite loop, even with the check
} currently implemented. (Same for "hash =foo".)
Hrmph, that's pretty silly.
diff --git a/Src/builtin.c b/Src/builtin.c
index 6f07fc6..c2fb81e 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3748,6 +3748,7 @@ bin_hash(char *name, char **argv, Options ops, UNUSED(int func))
if (!(asg = getasg(&argv, NULL))) {
zwarnnam(name, "bad assignment");
returnval = 1;
+ break;
} else if (ASG_VALUEP(asg)) {
if(isset(RESTRICTED)) {
zwarnnam(name, "restricted: %s", asg->value.scalar);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author