From: simonmar Date: Fri, 14 Sep 2001 14:51:06 +0000 (+0000) Subject: [project @ 2001-09-14 14:51:06 by simonmar] X-Git-Tag: Approximately_9120_patches~982 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7849c8aa807427f9ca8b0897b5d13cf399fd9d23;p=ghc-hetmet.git [project @ 2001-09-14 14:51:06 by simonmar] oops: hPutStr wasn't flushing a line-buffered handle properly at the end of a line. MERGE TO STABLE --- diff --git a/ghc/lib/std/PrelIO.hsc b/ghc/lib/std/PrelIO.hsc index e289596..ab06b78 100644 --- a/ghc/lib/std/PrelIO.hsc +++ b/ghc/lib/std/PrelIO.hsc @@ -3,7 +3,7 @@ #undef DEBUG_DUMP -- ----------------------------------------------------------------------------- --- $Id: PrelIO.hsc,v 1.11 2001/08/23 10:36:50 sewardj Exp $ +-- $Id: PrelIO.hsc,v 1.12 2001/09/14 14:51:06 simonmar Exp $ -- -- (c) The University of Glasgow, 1992-2001 -- @@ -22,7 +22,6 @@ module PrelIO where import PrelBase import PrelPosix -import PrelMarshalAlloc import PrelMarshalUtils import PrelStorable import PrelCError @@ -498,7 +497,12 @@ writeLines hdl Buffer{ bufBuf=raw, bufSize=len } s = return () shoveString n (c:cs) = do n' <- writeCharIntoBuffer raw n c - shoveString n' cs + if (c == '\n') + then do + new_buf <- commitBuffer hdl raw len n' True{-needs flush-} False + writeBlocks hdl new_buf cs + else + shoveString n' cs in shoveString 0 s