For record file stream indexing, stop looping if offset is unmodified
[idzebra-moved-to-github.git] / 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);