summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-01-10 11:41:54 -0800
committerStig Thormodsrud <stig@vyatta.com>2011-01-11 16:39:32 -0800
commit9c4b03e8b8d49aafea2ebb7a1d9a97639bd87fd5 (patch)
treec9da80dbdda4c266b57223bae593517449e0cd37 /src
parenta0896d805699494a4d4fcb2d30fece2678ee0fbf (diff)
downloadvyatta-cfg-9c4b03e8b8d49aafea2ebb7a1d9a97639bd87fd5.tar.gz
vyatta-cfg-9c4b03e8b8d49aafea2ebb7a1d9a97639bd87fd5.zip
reset initial parser state
(cherry picked from commit f780a3fe2703874219e70e7cf443846fd85e9a67)
Diffstat (limited to 'src')
-rw-r--r--src/cparse/cparse.ypp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cparse/cparse.ypp b/src/cparse/cparse.ypp
index 66ddfd3..b1958e9 100644
--- a/src/cparse/cparse.ypp
+++ b/src/cparse/cparse.ypp
@@ -190,11 +190,20 @@ cparse::parse_file(FILE *fin, Cstore& cs)
cparse_debug = 1;
#endif // ENABLE_PARSER_TRACE
+ // initial state
cparse_set_in(fin);
cstore = &cs;
-
- // root node
+ ndeact = 0;
+ ncomment = NULL;
+ nname = NULL;
+ nval = NULL;
+ node_map.clear();
+ pcomps.clear();
+ pcomp_is_value.clear();
+ cur_path.clear();
+ cur_node = NULL;
cur_parent = new CfgNode(pcomps, nname, nval, ncomment, ndeact, cstore);
+
if (cparse_parse() != 0) {
// parsing failed
return NULL;