File bzip2-maxlen20.patch of Package bzip2

--- compress.c
+++ compress.c
@@ -444,11 +444,9 @@
       /*--
         Recompute the tables based on the accumulated frequencies.
       --*/
-      /* maxLen was changed from 20 to 17 in bzip2-1.0.3.  See 
-         comment in huffman.c for details. */
       for (t = 0; t < nGroups; t++)
          BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), 
-                                 alphaSize, 17 /*20*/ );
+                                 alphaSize, 20 );
    }
 
 
@@ -485,7 +483,7 @@
          if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
          if (s->len[t][i] < minLen) minLen = s->len[t][i];
       }
-      AssertH ( !(maxLen > 17 /*20*/ ), 3004 );
+      AssertH ( !(maxLen > 20), 3004 );
       AssertH ( !(minLen < 1),  3005 );
       BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), 
                           minLen, maxLen, alphaSize );
--- huffman.c
+++ huffman.c
@@ -137,7 +137,10 @@
          Huffman codes with a maximum length of 17 bits.  However, in
          order to preserve backwards compatibility with bitstreams
          produced by versions pre-1.0.3, the decompressor must still
-         handle lengths of up to 20. */
+         handle lengths of up to 20.
+
+         SuSE: we changed it back to 20 to be compatible to older
+         bzip2 versions */
 
       for (i = 1; i <= alphaSize; i++) {
          j = weight[i] >> 8;
openSUSE Build Service is sponsored by