aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstevenwdv <stevenwdv@users.noreply.github.com>2021-09-11 13:17:11 +0200
committerHisham Muhammad <hisham@gobolinux.org>2022-02-17 02:16:50 -0300
commitc3d13d216ae6be883491b929c1961b84e739a621 (patch)
tree824d07b2ddacc558d57eb3a74f1cb506d70e2a15 /src
parent9ea5e401e8c9ca71dfcf6298e8d7c8ec0f529fa2 (diff)
downloadluarocks-c3d13d216ae6be883491b929c1961b84e739a621.tar.gz
luarocks-c3d13d216ae6be883491b929c1961b84e739a621.tar.bz2
luarocks-c3d13d216ae6be883491b929c1961b84e739a621.zip
Prevent creation of directory named '-p' on Windows
`tools.make_dir` used `mkdir -p <name>` while `-p` [is not an existing switch](https://docs.microsoft.com/windows-server/administration/windows-commands/mkdir) on Windows. The switch is also not necessary because plain `mkdir` on Windows also creates intermediate directories.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/win32/tools.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua
index b8892b83..9bd050c6 100644
--- a/src/luarocks/fs/win32/tools.lua
+++ b/src/luarocks/fs/win32/tools.lua
@@ -36,7 +36,7 @@ end
36function tools.make_dir(directory) 36function tools.make_dir(directory)
37 assert(directory) 37 assert(directory)
38 directory = dir.normalize(directory) 38 directory = dir.normalize(directory)
39 fs.execute_quiet(vars.MKDIR.." -p ", directory) 39 fs.execute_quiet(vars.MKDIR, directory)
40 if not fs.is_dir(directory) then 40 if not fs.is_dir(directory) then
41 return false, "failed making directory "..directory 41 return false, "failed making directory "..directory
42 end 42 end