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

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



The last few lines of cancd2() in exec.c are:

    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
    if (us2)
	free(us2);

Surely those lines are in the wrong order.

Index: Src/exec.c
===========================================================================
 	fixdir(us2 = us);
     } else
 	us = unmeta(s);
-    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
     if (us2)
 	free(us2);
+    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
 }
 
 /**/

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



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