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

Re: mkdir -p buldtin is possibly incorrect?



George Kouryachy wrote:
> Why do you use "lstat" instead of "stat" in line 130?
> I have my $HOME symlinked as "/home -> /var/home",
> so any first attempt to use completion smaps like tths:
> _store_cache:mkdir:16: cannot make directory `/home': file exists

Yes, it looks like you're right.

Index: Src/Modules/files.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/files.c,v
retrieving revision 1.12
diff -u -r1.12 files.c
--- Src/Modules/files.c	2 Jun 2004 22:15:00 -0000	1.12
+++ Src/Modules/files.c	14 Jul 2005 20:11:13 -0000
@@ -127,7 +127,7 @@
     if(p) {
 	struct stat st;
 
-	if(!lstat(rpath, &st) && S_ISDIR(st.st_mode))
+	if(!stat(rpath, &st) && S_ISDIR(st.st_mode))
 	    return 0;
     }
     oumask = umask(0);

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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