For record file stream indexing, stop looping if offset is unmodified
authorAdam Dickmeiss <adam@indexdata.dk>
Sun, 29 Oct 2006 20:35:58 +0000 (20:35 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Sun, 29 Oct 2006 20:35:58 +0000 (20:35 +0000)
by call to filter. This appears as bug #234, but really isn't.

index/extract.c

index 1439538..f7dbde3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: extract.c,v 1.231 2006-10-29 17:20:01 adam Exp $
+/* $Id: extract.c,v 1.232 2006-10-29 20:35:58 adam Exp $
    Copyright (C) 1995-2006
    Index Data ApS
 
@@ -441,6 +441,8 @@ ZEBRA_RES zebra_extract_file(ZebraHandle zh, SYSNO *sysno, const char *fname,
     }
     while(1)
     {
+        off_t prev_off = streamp->tellf(streamp);
+
         r = zebra_extract_record_stream(zh, streamp,
                                         deleteFlag,
                                         0, /* tst_mode */
@@ -459,6 +461,8 @@ ZEBRA_RES zebra_extract_file(ZebraHandle zh, SYSNO *sysno, const char *fname,
        {
            break;
        }
+        if (prev_off == streamp->tellf(streamp))
+            break;
     }
     if (streamp)
         stream.destroy(streamp);