file(REAL_PATH): resolve symlinks before '..' components

Previously REAL_PATH would collapse paths before resolving any symlinks
so if `..` crossed a symlink the output from `REAL_PATH` would be wrong.

It looked like REAL_PATH did this by mistake since it was a side-effect
of ensuring we had an absolute path before resolving symlinks.
This commit is contained in:
Robert Maynard
2023-06-29 15:24:49 -04:00
parent b0054dd65c
commit 6b5f2dbbfe
17 changed files with 188 additions and 9 deletions

View File

@@ -981,6 +981,11 @@ Path Conversion
if ``USERPROFILE`` is not defined. On all other platforms, only ``HOME``
is used.
.. versionchanged:: 3.28
All symlinks are resolved before collapsing ``../`` components.
See policy :policy:`CMP0152`.
.. signature::
file(RELATIVE_PATH <variable> <directory> <file>)