diff options
author | Gary Houston <ghouston@arglist.com> | 1999-07-04 11:02:21 +0000 |
---|---|---|
committer | Gary Houston <ghouston@arglist.com> | 1999-07-04 11:02:21 +0000 |
commit | 6c9514275ba36bfdeb3aefae16f10bc8b462f19e (patch) | |
tree | 59266eb05e28e198a17ca932e3253f623b555aa3 /libguile/strings.c | |
parent | ab41a129a81117d7d05d4711549df14f5b3cb46c (diff) | |
download | guile-6c9514275ba36bfdeb3aefae16f10bc8b462f19e.tar.gz |
1999-07-04 Gary Houston <ghouston@easynet.co.uk>
* strports.c (scm_strprint_obj): bug fix: get pt from the port,
not from the parameter obj. (Thanks to Eric Moore.)
* ports.h: SCM_CRDY, SCM_CUC, SCM_CRDYP, SCM_SETRDY, SCM_CUNGET,
SCM_CGETUN, SCM_CLRDY, SCM_TRY_CLRDY, SCM_N_READY_CHARS: deleted.
* strings.c (scm_make_string): throw error if 2nd arg isn't
a char.
* unif.c (scm_uniform_array_read_x): fix reading from a port.
allow non-fports.
(scm_uniform_array_write): likewise.
1999-06-29 Gary Houston <ghouston@easynet.co.uk>
* ports.c (scm_drain_input): rewritten.
* fports.c (local_fclose): check putback_buf.
(local_read_flush): likewise.
* ports.c (scm_remove_from_port_table): maybe free putback_buf.
* ports.h (scm_port): replace cbuf/cbufend/cp with putback_buf/
putback_buf_size.
(SCM_INITIAL_PUTBACK_BUF_SIZE): renamed from SCM_INITIAL_CBUF_SIZE.
* ports.c (scm_grow_port_cbuf): deleted.
(scm_add_to_port_table): initialise putback_buf to 0. remove cbuf
stuff.
(scm_char_ready_p): check putback_buf
(scm_fill_buffer): likewise.
(scm_ungetc): rewritten.
1999-06-27 Gary Houston <ghouston@easynet.co.uk>
* fports.c (local_fclose): account for push-back buffer.
* ports.c (scm_char_ready_p): check the push-back buffer in
a new way.
* ioext.c (scm_do_read_line): remove the extra code to handle
the push-back buffer.
* ports.c (scm_getc): don't use SCM_CRDYP etc.
* ioext.c (scm_do_read_line): call scm_fill_buffer.
* ports.c (scm_ungetc): don't call SCM_CUNGET. reset the
read buffer pointers.
scm_fill_buffer: new procedure.
(scm_getc): call scm_fill_buffer.
* ports.h (struct scm_port): saved_read_buf, saved_read_pos,
saved_read_end: new fields.
1999-07-04 Gary Houston <ghouston@easynet.co.uk>
* configure.in: don't check for ways to violate stdio abstraction.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r-- | libguile/strings.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libguile/strings.c b/libguile/strings.c index 358b8ab86..708ef7581 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -246,19 +246,19 @@ scm_make_string (k, chr) SCM chr; { SCM res; - register unsigned char *dst; register long i; SCM_ASSERT (SCM_INUMP (k) && (k >= 0), k, SCM_ARG1, s_make_string); i = SCM_INUM (k); res = scm_makstr (i, 0); - dst = SCM_UCHARS (res); - if SCM_ICHRP (chr) + if (!SCM_UNBNDP (chr)) { - char c = SCM_ICHR (chr); - for (i--;i >= 0;i--) - { - dst[i] = c; - } + SCM_ASSERT (SCM_ICHRP (chr), chr, SCM_ARG2, s_make_string); + { + unsigned char *dst = SCM_UCHARS (res); + char c = SCM_ICHR (chr); + + memset (dst, c, i); + } } return res; } |