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

Re: mkdir builtin and $'\0'



2015-08-18 10:19:04 +0100, Stephane Chazelas:
[...]
> A bit worse:
> 
> $ strace -e chdir zsh -c "cd $'a\0b'; print -r -- \$PWD; pwd"
> chdir("/export/home/stephane/a")        = -1 ENOENT (No such file or directory)
> chdir("a\203 b")                        = 0
> chdir("..")                             = 0
> chdir("..")                             = 0
> chdir("..")                             = 0
> chdir("/home/stephane/a\203 b")         = 0
> /export/home/stephane/a
> /home/stephane/a� b
> +++ exited with 0 +++
> 
> I suppose the chdir("..")s come after the realisation that $PWD
> probably doesn't represent the current directory anymore (since
> chdir("$PWD/dir") doesn't work while chdir("dir") does).
[...]

How about my "cd" case?

The discrepancy between $PWD and pwd is strange there.

-- 
Stephane



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