summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2008-08-27 18:08:50 -0700
committerslioch <slioch@eng-140.vyatta.com>2008-08-27 18:08:50 -0700
commit166b05c2cae064cef888d80928ab8592648c5230 (patch)
tree6958c05d922367ec271ff8f98c54b500e2a1dab5
parent5ce4d3b9fbb4b8e7778f29162d6411dd4526830e (diff)
downloadvyatta-cfg-166b05c2cae064cef888d80928ab8592648c5230.tar.gz
vyatta-cfg-166b05c2cae064cef888d80928ab8592648c5230.zip
strip off whitespace in default value parsed from node.def file--fixes problem of deleting time-zone value without
value.
-rw-r--r--src/delete.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/delete.c b/src/delete.c
index 004986d..6fe4eb3 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -47,7 +47,18 @@ static boolean has_default(char **def, int size)
if (buf_ptr == NULL) {
break;
}
+
+ //iterate up to non-whitespace character
buf_ptr++;
+ while (buf_ptr < (buf + size)) {
+ if (*buf_ptr == ' ') {
+ buf_ptr++;
+ }
+ else {
+ break;
+ }
+ }
+
if (size < strlen(buf_ptr)-1) {
bye("default buffer size is too small\n");
}