From 90d9c793484d755d1e405fbfc82f80960d1f22f5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 13 Mar 2025 11:44:48 -0400 Subject: file(MAKE_DIRECTORY): Do not make directories for command keywords In commit 95323c90a1 (file(MAKE_DIRECTORY): Add optional RESULT keyword to capture failure., 2024-06-16, v3.31.0-rc1~414^2) we computed an updated range of arguments, that name directories to be created, before the `RESULT` keyword. However, we forgot to use it in the loop. Fixes: #26768 --- Source/cmFileCommand.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 92e6b3e..435534d 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -919,9 +919,7 @@ bool HandleMakeDirectoryCommand(std::vector const& args, } std::string expr; - for (std::string const& arg : - cmMakeRange(args).advance(1)) // Get rid of subcommand - { + for (std::string const& arg : argsRange) { const std::string* cdir = &arg; if (!cmsys::SystemTools::FileIsFullPath(arg)) { expr = -- cgit v0.12