[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:46:50 UTC 2010


The following commit has been merged in the master branch:
commit d05c59a47b84f605fb645cd99ee292a642cdc862
Author: John Goerzen <jgoerzen at complete.org>
Date:   Mon Nov 15 10:04:36 2004 +0100

    Checkpointing
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-45)

diff --git a/ChangeLog b/ChangeLog
index f754044..436e494 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-15 03:04:36 GMT	John Goerzen <jgoerzen at complete.org>	patch-45
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.5--patch-45
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/Printf.hs
+
+
 2004-11-15 02:39:16 GMT	John Goerzen <jgoerzen at complete.org>	patch-44
 
     Summary:
diff --git a/libsrc/MissingH/Printf.hs b/libsrc/MissingH/Printf.hs
index 537cfe4..00e9ec0 100644
--- a/libsrc/MissingH/Printf.hs
+++ b/libsrc/MissingH/Printf.hs
@@ -72,6 +72,16 @@ toflags (x:xs) = (case x of
                       '\'' -> Thousands
                       'I' -> AlternativeDigits) : toflags xs
 
+mkflags :: String -> [Flag]
+mkflags x =
+    let flags = toflags x
+        flags' = if LeftAdjust `elem` flags then filter (/= ZeroPadded) flags
+                                            else flags
+        flags'' = if Plus `elem` flags then filter (/= BlankPlus) flags
+                                       else flags'
+        in
+        flags''
+
 sprintf :: String -> [Value] -> String
 sprintf [] [] = []
 sprintf ('%' : '%' : xs) y = '%' : sprintf xs y
@@ -94,7 +104,7 @@ sprintf ('%' : xs) (y : ys) =
          Just (_, _, remainder, [flagstr, widthstr, precstr, [fmt]]) ->
              let width = if widthstr == "" then Nothing else Just ((read widthstr)::Width)
                  prec = if precstr == "" then Nothing else Just precstr
-                 flags = toflags flagstr
+                 flags = mkflags flagstr
                  in
                  --(show width) ++ sprintf remainder ys
                  (get_conversion_func fmt y flags width prec) ++ sprintf remainder ys

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list