[GHC] #9150: libraries/time: parseTime barfs on leading space in format string

GHC ghc-devs at haskell.org
Thu May 29 16:56:46 UTC 2014


#9150: libraries/time: parseTime barfs on leading space in format string
--------------------------+------------------------------------------------
       Reporter:  mjo     |             Owner:
           Type:  bug     |            Status:  new
       Priority:  normal  |         Milestone:
      Component:          |           Version:  7.8.2
  libraries (other)       |  Operating System:  Unknown/Multiple
       Keywords:          |   Type of failure:  Incorrect result at runtime
   Architecture:          |         Test Case:
  Unknown/Multiple        |          Blocking:
     Difficulty:          |
  Unknown                 |
     Blocked By:          |
Related Tickets:          |
--------------------------+------------------------------------------------
 This used to work around 1.4.0, one of my test suites caught it:

 {{{
 module Main
 where

 import Data.Time.Clock
 import Data.Time.Format
 import System.Locale

 main :: IO ()
 main = do
   putStrLn "Trailing space is handled:"
   print $ (parseTime defaultTimeLocale "%M " "15 " :: Maybe UTCTime)

   putStrLn "\nBut leading space isn't:"
   print $ (parseTime defaultTimeLocale " %M" " 15" :: Maybe UTCTime)
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9150>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list