Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys/base/readlink: bugfix involving resolution of symlinks in $PWD
Symlinks in the present working directory were not always resolved when canonicalising a path using -f/-e/-m; if a relative path was given that contained only one directory component (or only has an initial ./), then readlink failed to use 'chdir' to resolve symlinks in $PWD (the present working directory). lib/modernish/mdl/sys/base/readlink.mm: - Bugfix. Generally, '.' path components must be skipped so that 'readlink -m' works correctly. This erroneously skipped an (implicit or given) initial './' so the PWD was not canonicalised. So add a line to special-case that. In that case, also make sure $PWD exists, and refuse to canonicalise (even with -m) if not; this behaviour matches GNU 'readlink'. lib/modernish/tst/sys.t: - Add regression test that catches this bug.
- Loading branch information