[augeas-devel] augeas: master - * src/augeas.c (tree_replace): don't bother marking the new parent as dirty

David Lutterkort lutter at fedoraproject.org
Thu Jan 28 01:52:33 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=fe810ca0ed253c003f8d9758aedb48a116469da0
Commit:        fe810ca0ed253c003f8d9758aedb48a116469da0
Parent:        e02c950c452ebc3ea88b170bdb10fce4155b463d
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Wed Jan 27 17:50:20 2010 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Wed Jan 27 17:50:20 2010 -0800

* src/augeas.c (tree_replace): don't bother marking the new parent as dirty

We call tree_rm on it earlier, which already marks it as dirty.

This line also triggered a SEGV when sub == NULL; this happened, for
example, when /etc/apt/preferences was an empty file.

Bug reported by Matt Palmer
---
 src/augeas.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/augeas.c b/src/augeas.c
index 209f606..c910017 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -780,8 +780,6 @@ int tree_replace(struct tree *origin, const char *path, struct tree *sub) {
     list_for_each(s, sub) {
         s->parent = parent;
     }
-    if (sub->dirty)
-        tree_mark_dirty(parent);
     free_pathx(p);
     return 0;
  error:




More information about the augeas-devel mailing list