diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-10-24 09:57:30 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-10-24 09:57:30 -0700 |
commit | 07ac603a29d1157d0ed0d1629c2bf620b8846ef0 (patch) | |
tree | 807ddd4efcd5ac2b22b868d3670501ef2f6cf63a /src | |
parent | 510bd206970da7a8d5764f5465856952d11d6a73 (diff) | |
parent | b6b8db9771c217c0d0347e4880f3a516029532a6 (diff) | |
download | vyatta-cfg-07ac603a29d1157d0ed0d1629c2bf620b8846ef0.tar.gz vyatta-cfg-07ac603a29d1157d0ed0d1629c2bf620b8846ef0.zip |
Merge branch 'islavista' of suva.vyatta.com:/git/vyatta-cfg into islavista
Diffstat (limited to 'src')
-rw-r--r-- | src/delete.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c index 6fe4eb3..3011c12 100644 --- a/src/delete.c +++ b/src/delete.c @@ -78,6 +78,23 @@ static void reset_default(const char *def_val) if (def_val == NULL) return; + //strip off quotes + char tmp_val[1025]; + char *ptr = index(def_val,'"'); + if (ptr != NULL) { + strcpy(tmp_val,ptr+1); + ptr = rindex(tmp_val,'"'); + if (ptr != NULL) { + *ptr = '\0'; + } + else { + strcpy(tmp_val,def_val); //go with original value. + } + } + else { + strcpy(tmp_val,def_val); + } + char filename[strlen(m_path.path) + 10]; touch(); sprintf(filename, "%s/node.val", m_path.path); @@ -85,7 +102,7 @@ static void reset_default(const char *def_val) FILE *fp = fopen(filename, "w"); if (fp == NULL) bye("can not open: %s", filename); - fputs(def_val, fp); + fputs(tmp_val, fp); fclose(fp); sprintf(filename, "%s/def", m_path.path); |