unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Fixes `setvbuf'
@ 2006-04-03  7:59 Ludovic Courtès
  2006-04-06  0:12 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Courtès @ 2006-04-03  7:59 UTC (permalink / raw)


Hi,

Below is a patch that fixes `setvbuf'.

Thanks,
Ludovic.


2006-04-03  Ludovic Courtès  <ludovic.courtes@laas.fr>

	* libguile/fports.c (scm_setvbuf): When CMODE is not `_IOLBF',
	really clear the `SCM_BUFLINE' bit instead of toggling it.


--- orig/libguile/fports.c
+++ mod/libguile/fports.c
@@ -155,7 +155,9 @@
     }
   else
     {
-      SCM_SET_CELL_WORD_0 (port, SCM_CELL_WORD_0 (port) ^ SCM_BUFLINE);
+      if (SCM_CELL_WORD_0 (port) & SCM_BUFLINE)
+	/* Clear the ``line-buffered'' bit.  */
+	SCM_SET_CELL_WORD_0 (port, SCM_CELL_WORD_0 (port) ^ SCM_BUFLINE);
     }
 
   if (SCM_UNBNDP (size))





_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fixes `setvbuf'
  2006-04-03  7:59 [PATCH] Fixes `setvbuf' Ludovic Courtès
@ 2006-04-06  0:12 ` Kevin Ryde
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2006-04-06  0:12 UTC (permalink / raw)


ludovic.courtes@laas.fr (Ludovic Courtès) writes:
>
> +      if (SCM_CELL_WORD_0 (port) & SCM_BUFLINE)
> +	/* Clear the ``line-buffered'' bit.  */
> +	SCM_SET_CELL_WORD_0 (port, SCM_CELL_WORD_0 (port) ^ SCM_BUFLINE);

Thanks.  I applied a fix using a mask ("& ~BUFLINE").


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-06  0:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-03  7:59 [PATCH] Fixes `setvbuf' Ludovic Courtès
2006-04-06  0:12 ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).