summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--aconf/persistence/backends/augeas.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/aconf/persistence/backends/augeas.lua b/aconf/persistence/backends/augeas.lua
index 1496d5b..ab73c08 100644
--- a/aconf/persistence/backends/augeas.lua
+++ b/aconf/persistence/backends/augeas.lua
@@ -66,22 +66,22 @@ local function conv_path(path)
assert(mode ~= '&')
local comp = path[1]
- if contains({'#', '&'}, comp) or key_mode(comp) then
- assert(not mode)
- mode = comp
- elseif not mode then
- res = res..'/'..comp
- keys = {}
- else
+ if mode then
if mode == '#' then
assert(type(comp) == 'number')
res = append_pred(res, comp)
else
- assert(type(comp) == 'string' and comp:match('^[%w %_-%.]+$'))
+ assert(type(comp) == 'string' and comp:match('^[%w %_%-%.%#]+$'))
res = append_key_pred(res, mode, comp)
table.insert(keys, key(mode))
end
mode = nil
+
+ elseif contains({'#', '&'}, comp) or key_mode(comp) then mode = comp
+
+ else
+ res = res..'/'..comp
+ keys = {}
end
table.remove(path, 1)