summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-16 15:25:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-16 15:26:04 (GMT)
commitc0ac53b90c170e781b085e219dae6cc03cccdfd3 (patch)
treeba5e8c33751932fe601db14cb1e29cecbc7ffb48 /Source
parent1e728706de1457a25fe531d5905c28570a208a08 (diff)
parentc0da651c09e11f9868529b7f8c4dc8f97c4546c8 (diff)
downloadCMake-c0ac53b90c170e781b085e219dae6cc03cccdfd3.zip
CMake-c0ac53b90c170e781b085e219dae6cc03cccdfd3.tar.gz
CMake-c0ac53b90c170e781b085e219dae6cc03cccdfd3.tar.bz2
Merge topic 'file_download_filename'
c0da651c09 file(DOWNLOAD): Don't fail if given just a filename to write to b56d429324 Tests: Fix CMake.FileDownload test failures not reported 3bc73803b4 Tests: Fix CMake.FileDownload test in presence of proxy 1352585301 Tests: Extend CMake.FileDownload test internal timeouts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4159
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFileCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 1fdfa87..d1775a7 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1707,7 +1707,8 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
// as we receive downloaded bits from curl...
//
std::string dir = cmSystemTools::GetFilenamePath(file);
- if (!cmSystemTools::FileExists(dir) && !cmSystemTools::MakeDirectory(dir)) {
+ if (!dir.empty() && !cmSystemTools::FileExists(dir) &&
+ !cmSystemTools::MakeDirectory(dir)) {
std::string errstring = "DOWNLOAD error: cannot create directory '" + dir +
"' - Specify file by full path name and verify that you "
"have directory creation and file write privileges.";