darcs patch: Fixed typo to make it build on Windows
Ian Lynagh
igloo at earth.li
Tue Feb 26 14:42:58 EST 2008
Hi Satoshi,
On Wed, Feb 27, 2008 at 03:08:38AM +0900, Satoshi Kodama wrote:
> Wed Feb 27 02:44:26 JST 2008 Satoshi Kodama <s.skk.skk at gmail.com>
> * Fixed typo to make it build on Windows
Thanks for the patch! A few questions/comments:
> [Fixed typo to make it build on Windows
I think this refers to deleteFile/removeFile? There seems to be more
than one issue addressed in this patch, anyway.
> hunk ./Distribution/Simple/Utils.hs 527
> - `Exception.catch` \err -> do
> - exists <- fileExists targetFile
> + `catch` \err -> do
> + exists <- doesFileExist targetFile
I guess you're trying to fix a mismatch between the catch and the
"ioError err"? If so, I think it would be better to change ioError to
Exception.throw (or whatever the appropriate function is called).
> hunk ./Distribution/Simple/Utils.hs 685
> +-- lines' "foo\nbar\r\nbaz\r" == ["foo", "bar", "baz"]
> +lines' :: String -> [String]
> +lines' "" = []
> +lines' s = let (l, s') = break (`elem` "\r\n") s in l : case s' of
> + [] -> []
> + _:'\n':s'' -> lines' s''
> + _:s'' -> lines' s''
This gives
lines' "foo\n\n\nbar" == ["foo","","bar"]
Changing the first _ to '\r' would have the meaning I think you were
going for.
Thanks
Ian
More information about the cabal-devel
mailing list