[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-5-42-g49b

From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-5-42-g49bb5bd
Date: Fri, 27 Nov 2009 16:01:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, master has been updated
       via  49bb5bd30714af627ae78b0897ab05ba566e7c00 (commit)
      from  2858deaf47f339eff71574e42536f8d6955fb5a9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 49bb5bd30714af627ae78b0897ab05ba566e7c00
Author: Ludovic Courtès <address@hidden>
Date:   Fri Nov 27 17:00:51 2009 +0100

    Disable encoding scanning on non-seekable file ports.
    * libguile/read.c (scm_i_scan_for_encoding): Don't attempt to scan
      non-seekable file ports.


Summary of changes:
 libguile/read.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libguile/read.c b/libguile/read.c
index 4772c32..5219334 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -42,6 +42,7 @@
 #include "libguile/hashtab.h"
 #include "libguile/hash.h"
 #include "libguile/ports.h"
+#include "libguile/fports.h"
 #include "libguile/root.h"
 #include "libguile/strings.h"
 #include "libguile/strports.h"
@@ -1476,7 +1477,13 @@ scm_i_scan_for_encoding (SCM port)
   int i;
   int in_comment;
-  bytes_read = scm_c_read (port, header, SCM_ENCODING_SEARCH_SIZE);  
+  if (SCM_FPORTP (port) && !SCM_FDES_RANDOM_P (SCM_FPORT_FDES (port)))
+    /* PORT is a non-seekable file port (e.g., as created by Bash when using
+       "guile <(echo '(display "hello")')") so bail out.  */
+    return NULL;
+  bytes_read = scm_c_read (port, header, SCM_ENCODING_SEARCH_SIZE);
   scm_seek (port, scm_from_int (0), scm_from_int (SEEK_SET));
   if (bytes_read > 3 

GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]