> > When reading from a socket using hGetLine, 8bit characters cause
> > fatal error, e.g.:
> > 
> > Fail: Prelude.Enum.toEnum{Char}: out of range: -77
> 
> I think I found it. The bug always occurs in NoBuffering mode.
> 
> --- ghc/lib/std/cbits/readFile.c.orig Sun Feb  7 23:03:38 1999
> +++ ghc/lib/std/cbits/readFile.c      Thu Jul  1 11:09:54 1999
> @@ -258,7 +258,7 @@
>  {
>      IOFileObject* fo= (IOFileObject*)ptr;
>      int count,rc=0;
> -    char c;
> +    unsigned char c;
>  
>      /* Check if someone hasn't zapped us */
>      if ( fo == NULL || fo->fd == -1)
> 
> I can't check whether it works, because ghc-4.02 does not compile
> for me. Fortunately I can use LineBuffering for my sockets.

Committed, thanks.

What problem are you having getting ghc-4.02 to compile?

Cheers,
        Simon

Reply via email to