[tor-commits] [webstats/master] Stop truncating files when merging new lines into them.

runa at torproject.org runa at torproject.org
Sat Aug 11 19:47:23 UTC 2012


commit 4096c6aeae0ad61e6b3d7df5ded0171a1c68e83f
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Thu Aug 9 11:05:32 2012 +0200

    Stop truncating files when merging new lines into them.
    
    When merging newly sanitized lines into an existing file, we stopped as
    soon as the existing file ran out of lines.  We must also add the
    remaining new sanitized lines.
---
 src/org/torproject/webstats/Main.java |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/org/torproject/webstats/Main.java b/src/org/torproject/webstats/Main.java
index 1aa02d4..3be2c92 100644
--- a/src/org/torproject/webstats/Main.java
+++ b/src/org/torproject/webstats/Main.java
@@ -367,6 +367,9 @@ public class Main {
         }
         bw.write(line + "\n");
       }
+      while (cachedLinesListPosition < totalCachedLines) {
+        bw.write(cachedLinesList.get(cachedLinesListPosition++) + "\n");
+      }
       br.close();
       bw.close();
     } catch (IOException e) {



More information about the tor-commits mailing list