[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 14:49:37 UTC 2010
The following commit has been merged in the master branch:
commit 9c2ed17aa08bbf25439c933385838132994e9256
Author: John Goerzen <jgoerzen at complete.org>
Date: Sat Dec 4 05:03:40 2004 +0100
Checkpointing
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.7--patch-20)
diff --git a/ChangeLog b/ChangeLog
index 9da7b02..2e953ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
#
+2004-12-03 22:03:40 GMT John Goerzen <jgoerzen at complete.org> patch-20
+
+ Summary:
+ Checkpointing
+ Revision:
+ missingh--head--0.7--patch-20
+
+
+ modified files:
+ ChangeLog libsrc/MissingH/FileArchive/GZip.hs
+
+
2004-12-03 21:54:11 GMT John Goerzen <jgoerzen at complete.org> patch-19
Summary:
diff --git a/libsrc/MissingH/FileArchive/GZip.hs b/libsrc/MissingH/FileArchive/GZip.hs
index fa57e87..a4257b4 100644
--- a/libsrc/MissingH/FileArchive/GZip.hs
+++ b/libsrc/MissingH/FileArchive/GZip.hs
@@ -44,6 +44,15 @@ fFCOMMENT = 16
split1 :: String -> (Char, String)
split1 s = (head s, tail s)
+{- | Read a GZip file.
+-}
+
+decompress :: String -> Either GZipError String
+decompress s =
+ do x <- read_header s
+ let rem = snd x
+ return $ inflate_string rem
+
{- | Read the GZip header. Return (Header, Remainder).
-}
read_header :: String -> Either GZipError (String, String)
@@ -63,9 +72,26 @@ read_header s =
let rem = drop 6 rem
rem <- if (flag .&. fFEXTRA /= 0)
+ -- Skip past the extra field if we have it.
then do let (xlen_S, rem2) = split1 rem
let (xlen2_S, rem2) = split1 rem2
let xlen = (ord xlen_S) + 256 * (ord xlen2_S)
return $ drop xlen rem2
else return rem
- return ("foo", rem)
\ No newline at end of file
+
+ rem <- if (flag .&. fFNAME /= 0)
+ -- Skip past the null-terminated filename
+ then return $ tail $ dropWhile (/= '\x00') rem
+ else return rem
+
+ rem <- if (flag .&. fFCOMMENT /= 0)
+ -- Skip past the null-terminated comment
+ then return $ tail $ dropWhile (/= '\x00') rem
+ else return rem
+
+ rem <- if (flag .&. fFHCRC /= 0)
+ -- Skip past the header CRC
+ then return $ drop 2 rem
+ else return rem
+
+ return ("foo", rem)
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list