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

PATCH: Re: PATCH: 3.1.6-test-2: Premature `return' in cancd2()



On Jul 21,  6:15am, Bart Schaefer wrote:
} Subject: PATCH: 3.1.6-test-2: Premature `return' in cancd2()
}
} Surely those lines are in the wrong order.

Surely I've been up too late too often recently.  It's actually a good thing
that I snipped one too many lines from the header of the previous attempt,
so you probably can't even apply 7229; here's a better try (ignore 7229).

Index: Src/exec.c
===========================================================================
@@ -3145,6 +3145,7 @@
 {
     struct stat buf;
     char *us, *us2 = NULL;
+    int ret;
 
     /*
      * If CHASEDOTS and CHASELINKS are not set, we want to rationalize the
@@ -3159,9 +3160,10 @@
 	fixdir(us2 = us);
     } else
 	us = unmeta(s);
-    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
+    ret = !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
     if (us2)
 	free(us2);
+    return ret;
 }
 
 /**/

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author