summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-02 15:27:50 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-02 15:27:50 -0700
commitffe87454b93115be056a5ec99dd8300dafa9eb18 (patch)
tree0026175e63f647fab7e796f374d89be0fc7366b4 /lib.c
parent28d78722c037c1fc9cc20d50b33ecd100698dfb8 (diff)
downloadtxr-ffe87454b93115be056a5ec99dd8300dafa9eb18.tar.gz
txr-ffe87454b93115be056a5ec99dd8300dafa9eb18.tar.bz2
txr-ffe87454b93115be056a5ec99dd8300dafa9eb18.zip
bug: join-with segfault on character separators.
* lib.c (join_with): Pass the correct onech array down to cat_str_init, rather than a null pointer. * tests/015/split.tl: New tests covering join and join-with.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 95db82e4..7eb29a3e 100644
--- a/lib.c
+++ b/lib.c
@@ -5047,8 +5047,9 @@ val join_with(val sep, struct args *args)
val iter;
int more;
struct cat_str cs;
+ wchar_t onech[] = wini(" ");
- cat_str_init(&cs, sep, 0, self);
+ cat_str_init(&cs, sep, wref(onech), self);
for (index = 0, iter = args->list, more = args_more_nozap(args, index, iter);
more;)