diff options
| author | ruki <[email protected]> | 2020-12-26 00:25:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-26 00:25:53 +0800 |
| commit | 30b3d56226088ea31eee42aa4f8aacf122c66705 (patch) | |
| tree | bce52191a84972bbb7ef5905b3541de2d51f8e71 /xmake | |
| parent | 1b15710a90123fefd99838a27b35c6881ac466ca (diff) | |
improve winos.registry_values
Diffstat (limited to 'xmake')
| -rw-r--r-- | xmake/core/base/winos.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua index 483dbbd9f..57f83bb5e 100644 --- a/xmake/core/base/winos.lua +++ b/xmake/core/base/winos.lua @@ -288,8 +288,19 @@ function winos.registry_values(keypath) -- get the root directory local rootdir = keypath:sub(p + 1) - -- get values - return winos._registry_values(rootkey, rootdir, pattern) + -- get value names + local value_names = {} + local count, errors = winos._registry_values(rootkey, rootdir, function (value_name) + if not pattern or value_name:match("^" .. pattern .. "$") then + table.insert(value_names, value_name) + end + return true + end) + if count ~= nil then + return value_names + else + return nil, errors + end end -- return module: winos |
