diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-05-17 10:20:19 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-05-17 10:20:19 -0700 |
commit | 9d5b213893a79939ac8f2e871e18ba3163eeab50 (patch) | |
tree | 6504ea1e8fc18436cedd4d378752b05d0c8c3e74 /src/cstore/cstore-varref.cpp | |
parent | 7a9ad37b1f598ec44ee01fc16ad16526e45f1bf7 (diff) | |
download | vyatta-cfg-9d5b213893a79939ac8f2e871e18ba3163eeab50.tar.gz vyatta-cfg-9d5b213893a79939ac8f2e871e18ba3163eeab50.zip |
minor feature etc.
* add commit notification.
* fix relative VAR references that traverse up to root level.
Diffstat (limited to 'src/cstore/cstore-varref.cpp')
-rw-r--r-- | src/cstore/cstore-varref.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/cstore/cstore-varref.cpp b/src/cstore/cstore-varref.cpp index 7549834..efe1b04 100644 --- a/src/cstore/cstore-varref.cpp +++ b/src/cstore/cstore-varref.cpp @@ -140,18 +140,21 @@ Cstore::VarRef::process_ref(const Cpath& ref_comps, return; } pcomps.pop(); - def = _cstore->parseTmpl(pcomps, false); - if (!def.get()) { - // invalid tmpl path - return; - } - if (def->isTagValue()) { - // at "tag value", need to pop one more. - if (pcomps.size() == 0) { - // invalid path + if (pcomps.size() > 0) { + // not at root yet + def = _cstore->parseTmpl(pcomps, false); + if (!def.get()) { + // invalid tmpl path return; } - pcomps.pop(); + if (def->isTagValue()) { + // at "tag value", need to pop one more. + if (pcomps.size() == 0) { + // invalid path + return; + } + pcomps.pop(); + } } process_ref(rcomps, pcomps, ERROR_TYPE); } else if (cr_comp == "@@") { |