Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Infinite loop with "hash ="



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