diff options
Diffstat (limited to 'src/delete.c')
-rw-r--r-- | src/delete.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/delete.c b/src/delete.c index bb36fd1..b95a7d9 100644 --- a/src/delete.c +++ b/src/delete.c @@ -267,6 +267,28 @@ int main(int argc, char **argv) remove_rf(FALSE); return 0; } + + /* + let's do a new check here: + -> if this is a leaf and there is a value look for a match of the value + -> make sure to check existing configuration as well as uncommitted config + */ + if (ai+1 == argc) { + //does this work up until the last value + pop_path(&m_path); + if(lstat(m_path.path, &statbuf) == 0) { + //now compare last value with that in the node.def file to determine whether to accept this delete + status = get_value(&cp, &m_path); + if (status != VTWERR_OK) { + bye("Cannot read old value %s\n", m_path.path); + } + if (!strcmp(cp,argv[argc - 1])) { + remove_rf(FALSE); + return 0; + } + } + } + fprintf(out_stream, "The specified configuration node is not valid\n"); bye("There is no appropriate template for %s", m_path.path + strlen(get_mdirp())); |