diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-01 20:07:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-01 20:07:51 -0700 |
commit | ae05a8f6e9dbaa6f18a0d22475ab8fafc2b56506 (patch) | |
tree | ae68309aa0ac818f18aaa0cc3b0b82bdb25b7fef /lib.c | |
parent | fe4ee294894e05042b806fa2202b47ae635dc2a7 (diff) | |
download | txr-ae05a8f6e9dbaa6f18a0d22475ab8fafc2b56506.tar.gz txr-ae05a8f6e9dbaa6f18a0d22475ab8fafc2b56506.tar.bz2 txr-ae05a8f6e9dbaa6f18a0d22475ab8fafc2b56506.zip |
mkstring char argument is optional.
* eval.c (eval_init): Update registration of mkstring intrinsic
to make second argument optional.
* lib.c (mkstring): Default second argument to space.
* txr.1: Documentation of mkstring updated.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3313,7 +3313,7 @@ val string_8bit_size(const unsigned char *str, size_t sz) return string_own(wstr); } -val mkstring(val len, val ch) +val mkstring(val len, val ch_in) { size_t l = if3(minusp(len), (uw_throwf(error_s, lit("mkstring: negative size ~s specified"), @@ -3321,6 +3321,7 @@ val mkstring(val len, val ch) c_num(len)); wchar_t *str = chk_wmalloc(l + 1); val s = string_own(str); + val ch = default_arg_strict(ch_in, chr(' ')); wmemset(str, c_chr(ch), l); str[l] = 0; s->st.len = len; |