]> arthur.barton.de Git - bup.git/commitdiff
Aha, fixed a bug causing the split points not to resync.
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 4 Oct 2009 00:31:41 +0000 (20:31 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 4 Oct 2009 00:31:41 +0000 (20:31 -0400)
Makefile
hsplit.c

index f1e713cd63d3a6e86ad78c155d7f69e2b0797502..0e36d1d1cc5dc98a6685d6be0cb0c4b28f1e3ab6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ all: hsplit
 
 hsplit: hsplit.o
 
-hjoin: hjoin.o
+hjoin: hjoin.sh
 
 test: hsplit
        ./hsplit <testfile1 >tags1
@@ -14,6 +14,10 @@ test: hsplit
 %: %.o
        gcc -o $@ $< $(LDFLAGS) $(LIBS)
        
+%: %.sh
+       rm -f $@
+       ln -s $^ $@
+       
 %.o: %.c
        gcc -c -o $@ $^ $(CPPFLAGS) $(CFLAGS)
 
index d15da1cb4d19fb73a380c0dcd438af81728cd02c..fe130c8286eb1f342f18d6b5970fa67c34e1b67c 100644 (file)
--- a/hsplit.c
+++ b/hsplit.c
@@ -66,17 +66,28 @@ int main()
        sum = stupidsum_add(sum, buf[i], c);
        buf[i] = c;
        
-       //int cprint = (c >= 32 && c <= 126) ? c : '.';
-       //fprintf(stderr, "[%05X] %02X '%c' %08X\n", i, c, cprint, sum);
+       if (0)
+       {
+           int j;
+           fprintf(stderr, "[%5X] %08X  '", i, sum);
+           for (j = i+1; j < i+1+WINDOWSIZE; j++)
+           {
+               int d = buf[j % WINDOWSIZE];
+               fputc((d >= 32 && d <= 126) ? d : '.', stderr);
+           }
+           fprintf(stderr, "'\n");
+       }
        
        i = (i + 1) % WINDOWSIZE;
        count++;
        
        if ((sum & (BLOBSIZE-1)) == 0)
        {
-           fprintf(stderr, "SPLIT @ %d (%d)\n", count, BLOBSIZE);
-           count = i = 0;
+           fprintf(stderr, "SPLIT @ %-8d (%d/%d)\n",
+                   count, BLOBSIZE, WINDOWSIZE);
+           i = 0;
            memset(buf, 0, sizeof(buf));
+           sum = 0;
            if (pipe)
            {
                fflush(stderr);