@opindex --canonicalize
Activate canonicalize mode.
If any component of the file name except the last one is missing or unavailable,
-@command{readlink} produces no output and exits with a nonzero exit code.
+@command{readlink} produces no output and exits with a nonzero exit
+code. A trailing slash is ignored.
@item -e
@itemx --canonicalize-existing
@opindex --canonicalize-existing
Activate canonicalize mode.
If any component is missing or unavailable, @command{readlink} produces
-no output and exits with a nonzero exit code.
+no output and exits with a nonzero exit code. A trailing slash
+requires that the name resolve to a directory.
@item -m
@itemx --canonicalize-missing
ln -s subdir link2 || framework_failure
ln -s missing link3 || framework_failure
ln -s subdir/missing link4 || framework_failure
+ln -s link5 link5 || framework_failure
cd "$pwd/$tmp/removed" || framework_failure
v=`readlink -f "${p}subdir/more"` || fail=1
test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
- v=`readlink -f "${p}./subdir/more/"` && fail=1
- test -z "$v" || fail=1
+ v=`readlink -f "${p}./subdir/more/"` || fail=1
+ test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
v=`readlink -f "${p}missing"` || fail=1
test "$v" = "$my_pwd/$tmp/missing" || fail=1
- v=`readlink -f "${p}./missing/"` && fail=1
- test -z "$v" || fail=1
+ v=`readlink -f "${p}./missing/"` || fail=1
+ test "$v" = "$my_pwd/$tmp/missing" || fail=1
v=`readlink -f "${p}missing/more"` && fail=1
test -z "$v" || fail=1
v=`readlink -f "${p}link2/more"` || fail=1
test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
- v=`readlink -f "${p}./link2/more/"` && fail=1
- test -z "$v" || fail=1
+ v=`readlink -f "${p}./link2/more/"` || fail=1
+ test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
v=`readlink -f "${p}link2/more/more2"` && fail=1
test -z "$v" || fail=1
v=`readlink -f "${p}link3"` || fail=1
test "$v" = "$my_pwd/$tmp/missing" || fail=1
- v=`readlink -f "${p}./link3/"` && fail=1
- test -z "$v" || fail=1
+ v=`readlink -f "${p}./link3/"` || fail=1
+ test "$v" = "$my_pwd/$tmp/missing" || fail=1
v=`readlink -f "${p}link3/more"` && fail=1
test -z "$v" || fail=1
v=`readlink -f "${p}link4"` || fail=1
test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1
- v=`readlink -f "${p}./link4/"` && fail=1
- test -z "$v" || fail=1
+ v=`readlink -f "${p}./link4/"` || fail=1
+ test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1
v=`readlink -f "${p}link4/more"` && fail=1
test -z "$v" || fail=1
+
+ v=`readlink -f "${p}./link4/more"` && fail=1
+ test -z "$v" || fail=1
+
+ v=`readlink -f "${p}link5"` && fail=1
+ test -z "$v" || fail=1
+
+ v=`readlink -f "${p}./link5/"` && fail=1
+ test -z "$v" || fail=1
+
+ v=`readlink -f "${p}link5/more"` && fail=1
+ test -z "$v" || fail=1
+
+ v=`readlink -f "${p}./link5/more"` && fail=1
+ test -z "$v" || fail=1
done
Exit $fail