Files
CMake/Source/cmCMakePath.cxx
FeRD (Frank Dana) b0be1bd9ca cmake_path: Fix 'GET "foo/.." STEM' result
`cmake_path(GET "foo/.." STEM out)` is supposed to set `out` to `".."`,
the entire `cmake_path(GET "foo/.." FILENAME)` result.

However, the `GetNarrowStem()` logic in `cmCMakePath` was lacking
the `.` and `..` special-casing logic present in other methods.
As a result, it would erroneously trim the second `.` off of a stem
of `..` and return only `.`.

This caused the result of `cmake_path(GET "foo/.." STEM)` to be `"."`.

Making the standard empty-or-.-or-.. checks and bailing out early
fixes the result of `cmCMakePaths{".."}.GetNarrowStem()`.

Fixes: #26235
2024-08-26 09:55:57 -04:00

3.4 KiB