summaryrefslogtreecommitdiffstats
path: root/aconf/persistence
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-06-25 16:28:35 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-06-25 16:28:35 +0300
commitbdfd467ef1ea44d40d994c1d6edb090421aca774 (patch)
treec6282b493c8ae6ee99f463333c8146f45dbe2fe7 /aconf/persistence
parent321fe387894ffbbd7d4d67c6330952ec0343c678 (diff)
downloadaconf-bdfd467ef1ea44d40d994c1d6edb090421aca774.tar.bz2
aconf-bdfd467ef1ea44d40d994c1d6edb090421aca774.tar.xz
augeas backend: allow '#' as value of key component
Diffstat (limited to 'aconf/persistence')
-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)