diff --git a/src/CHANGELOG b/src/CHANGELOG index 282ba5c80..69f1eef4f 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -272,6 +272,10 @@ ECL 0.9i - [Win32] EXT::RUN-PROGRAM does not show a command window anymore (M. Goffioul) + - When a file is actually a symbolic link and this symbolic link contains a + relative pathname, the truename is obtained by merging the symbolic link + with the original pathname. + * Documentation: - The HTML manuals now use CSS for a more appealing look. diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index 3f969082a..d69d20dc1 100644 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -187,7 +187,12 @@ cl_truename(cl_object orig_pathname) FEcannot_open(orig_pathname); #ifdef HAVE_LSTAT } else if (kind == @':link') { - filename = si_readlink(filename); + /* The link might be a relative pathname. In that case we have + * to merge with the original pathname */ + filename = cl_merge_pathnames(2, si_readlink(filename), + make_pathname(Cnil, Cnil, + cl_pathname_directory(1,filename), + Cnil, Cnil, Cnil)); #endif } else { filename = OBJNULL;