GNU bug report logs - #12216
peek-char incorrectly *CONSUMES* eof

Previous Next

Package: guile;

Reported by: dwheeler <at> dwheeler.com

Date: Fri, 17 Aug 2012 02:03:01 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


Message #72 received at 12216 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Mark H Weaver <mhw <at> netris.org>
Cc: almkglor <almkglor <at> gmail.com>, dwheeler <at> dwheeler.com,
	12216 <12216 <at> debbugs.gnu.org>
Subject: Re: bug#12216: peek-char incorrectly *CONSUMES* eof
Date: Tue, 02 Apr 2013 09:58:43 +0200
Looks like a good start.  Two comments:

On Mon 01 Apr 2013 23:27, Mark H Weaver <mhw <at> netris.org> writes:

> --- a/libguile/inline.h
> +++ b/libguile/inline.h
> @@ -134,7 +134,10 @@ scm_peek_byte_or_eof (SCM port)
>    if (pt->read_pos >= pt->read_end)
>      {
>        if (SCM_UNLIKELY (scm_fill_input (port) == EOF))
> -	return EOF;
> +        {
> +          scm_i_set_pending_eof (port);
> +          return EOF;
> +        }
>      }
>  

1. I don't much like the addition of this call to this inline function.
Can we move all the non-fast-path code into some other function?  That
would include the flush call as well.

2. I think we probably need some tests.

Thanks for looking at this :-)

Andy
-- 
http://wingolog.org/




This bug report was last modified 12 years and 50 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.