diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-03-18 14:24:40 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-03-18 14:24:40 -0700 |
commit | c62c865df60dbe0d684ec00d86426053da8eb662 (patch) | |
tree | cb6b47f828d84b6e9161e5119f396dc2e01ab106 /src/cnode | |
parent | 3c5d31bc073c6064fb4f9e595f5f18df64846dfd (diff) | |
download | vyatta-cfg-c62c865df60dbe0d684ec00d86426053da8eb662.tar.gz vyatta-cfg-c62c865df60dbe0d684ec00d86426053da8eb662.zip |
fix for bug 6927
* handle "default state transition" correctly for "show".
Diffstat (limited to 'src/cnode')
-rw-r--r-- | src/cnode/cnode-algorithm.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cnode/cnode-algorithm.cpp b/src/cnode/cnode-algorithm.cpp index c6b91f9..09534c8 100644 --- a/src/cnode/cnode-algorithm.cpp +++ b/src/cnode/cnode-algorithm.cpp @@ -315,6 +315,7 @@ _diff_check_and_show_leaf(const CfgNode *cfg1, const CfgNode *cfg2, int level, const CfgNode *cfg = NULL; const char *force_pfx_diff = NULL; + bool is_default = (cfg2 ? cfg2->isDefault() : cfg1->isDefault()); if (!cfg1) { cfg = cfg2; force_pfx_diff = PFX_DIFF_ADD.c_str(); @@ -388,7 +389,7 @@ _diff_check_and_show_leaf(const CfgNode *cfg1, const CfgNode *cfg2, int level, } } else { // single-value node - if (show_def || !cfg->isDefault()) { + if (show_def || !is_default) { string val = cfg->getValue(); if (!force_pfx_diff) { const string& val1 = cfg1->getValue(); |