summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-05 00:16:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-03-05 00:16:37 -0800
commit67ac7a217bdfd6e4a813cc6caa68a75fb754e28b (patch)
tree2a4f50e9ae3bc421b0ad7a91de130a4ed0ac7a38 /stream.c
parent22ed7f473a5c1e1db722286f98b2457a74cc1ca7 (diff)
downloadtxr-67ac7a217bdfd6e4a813cc6caa68a75fb754e28b.tar.gz
txr-67ac7a217bdfd6e4a813cc6caa68a75fb754e28b.tar.bz2
txr-67ac7a217bdfd6e4a813cc6caa68a75fb754e28b.zip
* stream.c (put_line): Default string argument to empty string.
(stream_init): Change how put_line is registered to take advantage of new optional parameter. * txr.1: Updated.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stream.c b/stream.c
index 3a3d2d77..5761894e 100644
--- a/stream.c
+++ b/stream.c
@@ -1968,7 +1968,7 @@ val put_byte(val byte, val stream)
val put_line(val string, val stream)
{
- return (put_string(string, stream), put_char(chr('\n'), stream));
+ return (put_string(default_arg(string, null_string), stream), put_char(chr('\n'), stream));
}
val flush_stream(val stream)
@@ -2678,7 +2678,7 @@ void stream_init(void)
reg_fun(intern(lit("get-char"), user_package), func_n1o(get_char, 0));
reg_fun(intern(lit("get-byte"), user_package), func_n1o(get_byte, 0));
reg_fun(intern(lit("put-string"), user_package), func_n2o(put_string, 1));
- reg_fun(intern(lit("put-line"), user_package), func_n2o(put_line, 1));
+ reg_fun(intern(lit("put-line"), user_package), func_n2o(put_line, 0));
reg_fun(intern(lit("put-char"), user_package), func_n2o(put_char, 1));
reg_fun(intern(lit("put-byte"), user_package), func_n2o(put_byte, 1));
reg_fun(intern(lit("unget-char"), user_package), func_n2o(unget_char, 1));