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

Re: Next release (5.3)



Here's a script that's broken by the change.

I'm not saying *any* of the following:

- that this is a way I'd recommend doing things
- that there are no ways round the problem
- that leaving resolution of ".." to the last minute is a good idea

--- but I *am* saying that this script works according to the currently
documented behaviour and wouldn't any more.

pws


#!/usr/local/bin/zsh

# No CHASE_*.
emulate zsh

top=~/tmp/A_dir/data
real=$top/blah/real
link=$top/link

rm -rf $top
mkdir -p $real
ln -s $real $link

cd $link
print "In symbolic link:"
pwd
pwd -P

dir=$PWD
parent=$PWD/..

print "\nIn parent:"
cd $parent
pwd
pwd -P

print "\nIn symbolic link:"
cd $dir
pwd
pwd -P

print "This is the correct file" >$top/file
print "This is not the correct file.  I wouldn't be seeing this
if someone hadn't made any arbitrary change to the :A modifier that
changes the documented behaviour." >$real/../file

file=$parent/file

# We know :A resolves using the same rules as directory changing,
# so use that.
resolved=($file(:A))
print "\nUsing $file with :A => $resolved"
cat $resolved



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