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

Re: zsh sometimes sets $PWD to "." when executed



This happens when zsh gets a failure return from stat(".", &sbuf), e.g. 
because of a permission problem.  If zsh can't stat() the current 
directory, it sets its internal pwd string to dot and gives up.

Try compiling this:

	#include <stdio.h>
	#include <sys/stat.h>
	main() {
	  struct stat sbuf;
	  if (stat(".", &sbuf) < 0) perror("");
	}

Then run it in the same circumstance in which zsh fails.



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