From c21722b0a369bad430dc8c06d645cfd75854a6ec Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Fri, 18 Mar 2005 22:12:54 +0000 Subject: [PATCH] Fix another hashtree bug in restore causing "removenode: non-empty directory" --- CHANGES | 6 +++++- restore/restore.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index b57c960..d6d93ff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.272 2005/03/02 08:46:54 stelian Exp $ +$Id: CHANGES,v 1.273 2005/03/18 22:12:54 stelian Exp $ Changes between versions 0.4b39 and 0.4b40 (released ????????????????) ====================================================================== @@ -20,6 +20,10 @@ Changes between versions 0.4b39 and 0.4b40 (released ????????????????) to Philip Goisman for reporting the bug. +4. Fixed another bug introduced in restore with the hashtree + implementation. This one caused restore to stop saying + "removenode: non-empty directory" in some cases. + Changes between versions 0.4b38 and 0.4b39 (released January 21, 2005) ====================================================================== diff --git a/restore/restore.c b/restore/restore.c index 5fcff70..94e0bb6 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.35 2004/12/15 11:00:01 stelian Exp $"; + "$Id: restore.c,v 1.36 2005/03/18 22:12:55 stelian Exp $"; #endif /* not lint */ #include @@ -635,15 +635,19 @@ removeoldnodes(void) change = 0; prev = &removelist; for (ep = removelist; ep != NULL; ep = *prev) { + int docont = 0; if (ep->e_entries != NULL) { int i; for (i = 0; i < DIRHASH_SIZE; i++) { if (ep->e_entries[i] != NULL) { prev = &ep->e_next; - continue; + docont = 1; + break; } } } + if (docont) + continue; *prev = ep->e_next; removenode(ep); freeentry(ep); -- 2.39.2