summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-21 13:20:01 (GMT)
committerBrad King <brad.king@kitware.com>2019-05-21 13:25:32 (GMT)
commita1eb03569d0e82fb6eaf9a11da1960cfa456f5ef (patch)
tree25283c5ad6e24dcbdf80eb8bad912ca6892f21f9 /Help/command
parent1db0edb2a65b272a7c91e719e818da2e2ce49fb5 (diff)
downloadCMake-a1eb03569d0e82fb6eaf9a11da1960cfa456f5ef.zip
CMake-a1eb03569d0e82fb6eaf9a11da1960cfa456f5ef.tar.gz
CMake-a1eb03569d0e82fb6eaf9a11da1960cfa456f5ef.tar.bz2
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
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/file.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 0664e7c..f99021e 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -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: