summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>1999-09-18 08:36:35 +0000
committerGary Houston <ghouston@arglist.com>1999-09-18 08:36:35 +0000
commite684c60f44de155f5949d947c57baca870f827af (patch)
treef027b855ae5840871c5fd2fe35d7b45078f2767e
parent46a47bedc27a37a94fa1874c9965b1ba533f81fc (diff)
downloadguile-e684c60f44de155f5949d947c57baca870f827af.tar.gz
1999-09-18 Gary Houston <ghouston@freewire.co.uk>
* strports.c (scm_strport_to_string): create the string from pt->read_buf instead of an expression that evaluates to the same thing. * gdbint.c (gdb_print): don't just use SCM_CHARS to get a C string from the port: the port's buffer may not be NUL terminated.
-rw-r--r--libguile/ChangeLog9
-rw-r--r--libguile/gdbint.c8
-rw-r--r--libguile/strports.c3
3 files changed, 17 insertions, 3 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index cdee3a6ac..7cd349f22 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,12 @@
+1999-09-18 Gary Houston <ghouston@freewire.co.uk>
+
+ * strports.c (scm_strport_to_string): create the string from
+ pt->read_buf instead of an expression that evaluates to the
+ same thing.
+
+ * gdbint.c (gdb_print): don't just use SCM_CHARS to get a C string
+ from the port: the port's buffer may not be NUL terminated.
+
1999-09-16 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
* Makefile.am (.c.x): Added missing semicolon after `false'.
diff --git a/libguile/gdbint.c b/libguile/gdbint.c
index e2f429c8d..c3c6cdd38 100644
--- a/libguile/gdbint.c
+++ b/libguile/gdbint.c
@@ -275,7 +275,13 @@ gdb_print (obj)
scm_seek (gdb_output_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET));
scm_write (obj, gdb_output_port);
scm_truncate_file (gdb_output_port, SCM_UNDEFINED);
- SEND_STRING (SCM_CHARS (SCM_STREAM (gdb_output_port)));
+ {
+ scm_port *pt = SCM_PTAB_ENTRY (gdb_output_port);
+
+ scm_flush (gdb_output_port);
+ *(pt->write_buf + pt->read_buf_size) = 0;
+ SEND_STRING (pt->read_buf);
+ }
SCM_END_FOREIGN_BLOCK;
return 0;
}
diff --git a/libguile/strports.c b/libguile/strports.c
index 4ea718f23..3989fb111 100644
--- a/libguile/strports.c
+++ b/libguile/strports.c
@@ -266,8 +266,7 @@ SCM scm_strport_to_string (SCM port)
if (pt->rw_active == SCM_PORT_WRITE)
st_flush (port);
- return scm_makfromstr (SCM_CHARS (SCM_STREAM (port)),
- pt->read_buf_size, 0);
+ return scm_makfromstr (pt->read_buf, pt->read_buf_size, 0);
}
SCM_PROC(s_call_with_output_string, "call-with-output-string", 1, 0, 0, scm_call_with_output_string);