2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / ICSharpCode.SharpZipLib / ICSharpCode.SharpZipLib / Zip / Compression / InflaterHuffmanTree.cs
index 7ba56808f26c3c8d3ec193d695edd22cf4cecff9..02beb60a34c8273facc804a35e61c54afaa717aa 100644 (file)
@@ -39,7 +39,8 @@ using System;
 \r
 using ICSharpCode.SharpZipLib.Zip.Compression.Streams;\r
 \r
-namespace ICSharpCode.SharpZipLib.Zip.Compression {\r
+namespace ICSharpCode.SharpZipLib.Zip.Compression \r
+{\r
        \r
        public class InflaterHuffmanTree \r
        {\r
@@ -96,8 +97,9 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
                        \r
                        for (int i = 0; i < codeLengths.Length; i++) {\r
                                int bits = codeLengths[i];\r
-                               if (bits > 0)\r
+                               if (bits > 0) {\r
                                        blCount[bits]++;\r
+                               }\r
                        }\r
                        \r
                        int code = 0;\r
@@ -112,9 +114,12 @@ namespace ICSharpCode.SharpZipLib.Zip.Compression {
                                        treeSize += (end - start) >> (16 - bits);\r
                                }\r
                        }\r
-                       if (code != 65536) {\r
+/* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g\r
+                       if (code != 65536) \r
+                       {\r
                                throw new Exception("Code lengths don't add up properly.");\r
                        }\r
+*/\r
                        /* Now create and fill the extra tables from longest to shortest\r
                        * bit len.  This way the sub trees will be aligned.\r
                        */\r