From c62c865df60dbe0d684ec00d86426053da8eb662 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Fri, 18 Mar 2011 14:24:40 -0700 Subject: fix for bug 6927 * handle "default state transition" correctly for "show". --- src/cnode/cnode-algorithm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cnode') 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(); -- cgit v1.2.3