Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh sometimes sets $PWD to "." when executed
- X-seq: zsh-workers 20187
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: zsh sometimes sets $PWD to "." when executed
- Date: Fri, 23 Jul 2004 11:03:13 -0700 (PDT)
- Cc: Vincent Lefevre <vincent@xxxxxxxxxx>, 221875-forwarded@xxxxxxxxxxxxxxx
- In-reply-to: <20040723174044.GA10121@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20031224182536.GU1501@xxxxxxxxxxxx> <20040723174044.GA10121@xxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
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