Don't rebase ib->currroot if it was NULL.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Nov 2008 11:36:12 +0000 (11:36 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Nov 2008 11:36:12 +0000 (11:36 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8314 cda61777-01e9-0310-a592-d414129be87e

index.c

diff --git a/index.c b/index.c
index db3d2b3..c42da39 100644 (file)
--- a/index.c
+++ b/index.c
@@ -269,7 +269,9 @@ void indexbuild_rebase(indexbuild *ib, void *t)
     ib->t = t;
     ib->nodes = (struct avlnode *)((unsigned char *)ib->nodes + diff);
     ib->roots = (off_t *)((unsigned char *)ib->roots + diff);
-    ib->currroot = (struct avlnode *)((unsigned char *)ib->currroot + diff);
+    if (ib->currroot)
+       ib->currroot = (struct avlnode *)
+           ((unsigned char *)ib->currroot + diff);
     ib->firstmutable = (struct avlnode *)((unsigned char *)ib->firstmutable + diff);
 }