mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-26 10:48:38 -06:00
file: Change REMOVE to ignore empty names
Previously code like
file(REMOVE_RECURSE "${accidentally_missing_variable}")
treated the empty string as a relative path with respect to the
current directory and removed its contents. Change this behavior
to ignore the empty string with a warning instead.
Normally such behavior changes are done with a policy, but in this case
such code is likely a real bug in project code that can delete data.
Fixes: #19274
This commit is contained in:
@@ -292,7 +292,8 @@ Move a file or directory within a filesystem from ``<oldname>`` to
|
||||
|
||||
Remove the given files. The ``REMOVE_RECURSE`` mode will remove the given
|
||||
files and directories, also non-empty directories. No error is emitted if a
|
||||
given file does not exist.
|
||||
given file does not exist. Relative input paths are evaluated with respect
|
||||
to the current source directory. Empty input paths are ignored with a warning.
|
||||
|
||||
.. _MAKE_DIRECTORY:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user