diff options
| author | ruki <[email protected]> | 2020-03-01 11:33:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-03-01 11:33:28 +0800 |
| commit | 6018704f4bfdf1906b6a45f4bb92679cefc57629 (patch) | |
| tree | c3e29b11a3050d12a179751d2d811309355a8021 /xmake/core/base/os.lua | |
| parent | 4a15e79d3d83174b8a81bb192bcb3d86692b2cab (diff) | |
improve os.argw and disable wildcards for os.execv
Diffstat (limited to 'xmake/core/base/os.lua')
| -rw-r--r-- | xmake/core/base/os.lua | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index ff0b494e8..92545d261 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -205,10 +205,8 @@ function os.argw(argv) -- match all arguments local results = {} for _, arg in ipairs(table.wrap(argv)) do - - -- exists wildcards? - if arg:find("([%+%-%^%$%*%[%]%%])") then - local pathes = os.match(arg, 'a') + if arg:find("*", 1, true) then + local pathes = os.filedirs(arg) if #pathes > 0 then table.join2(results, pathes) else @@ -682,7 +680,7 @@ end -- @param program "clang", "xcrun -sdk macosx clang", "~/dir/test\ xxx/clang" -- filename "clang", "xcrun"", "~/dir/test\ xxx/clang" -- @param argv the arguments --- @param opt the options, e.g. {wildcards = false, stdout = filepath/file/pipe, stderr = filepath/file/pipe, +-- @param opt the options, e.g. {stdout = filepath/file/pipe, stderr = filepath/file/pipe, -- envs = {PATH = "xxx;xx", CFLAGS = "xx"}} -- function os.execv(program, argv, opt) @@ -690,15 +688,6 @@ function os.execv(program, argv, opt) -- init options opt = opt or {} - -- enable wildcards? default enabled - local wildcards = opt.wildcards - if wildcards == nil then - wildcards = true - end - - -- translate arguments for wildcards - argv = wildcards and os.argw(argv) or argv - -- is not executable program file? local filename = program if not os.isexec(program) then |
