summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbalocca <rbalocca@vyatta.com>2008-10-07 15:34:32 -0700
committerrbalocca <rbalocca@vyatta.com>2008-10-07 15:34:32 -0700
commit81c94e24cb94b352a9346b6eb03f1e4fcd123f98 (patch)
tree20906d2b5be1bb1dea7776d329ff811dba5c4a63
parent0a31f85bd2b63af24aa6fecd08a8c75ac45f4535 (diff)
parentd84444065bd1c05de86012910c16cdf12f95f505 (diff)
downloadvyatta-cfg-81c94e24cb94b352a9346b6eb03f1e4fcd123f98.tar.gz
vyatta-cfg-81c94e24cb94b352a9346b6eb03f1e4fcd123f98.zip
Merge branch 'islavista' of http://git.vyatta.com/vyatta-cfg into islavista
-rw-r--r--src/delete.c19
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);