mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
`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
3.4 KiB
3.4 KiB