diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-02 15:27:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-02 15:27:50 -0700 |
commit | ffe87454b93115be056a5ec99dd8300dafa9eb18 (patch) | |
tree | 0026175e63f647fab7e796f374d89be0fc7366b4 /lib.c | |
parent | 28d78722c037c1fc9cc20d50b33ecd100698dfb8 (diff) | |
download | txr-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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;) |