diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-08-07 22:48:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-08-07 22:48:19 -0700 |
commit | 3736361f915a7df8ed3ffc9a52b47e7af6bc280b (patch) | |
tree | 7446b9d26ab6765edbb749f730f95926fa9f9b06 /lib.c | |
parent | 6dcd7a72d53ee4b1bd799e190cf492f8b7c97bc8 (diff) | |
download | txr-3736361f915a7df8ed3ffc9a52b47e7af6bc280b.tar.gz txr-3736361f915a7df8ed3ffc9a52b47e7af6bc280b.tar.bz2 txr-3736361f915a7df8ed3ffc9a52b47e7af6bc280b.zip |
cygwin: bugs in string catenation and splitting.
This looks like it originates in June 19, 2019 commit
28c6225fec6ce999806e9c077f08ed0e668646c4, before Version 218.
The commit introduced the ability to use a character object
as a separator in cat_str and split_str_keep. The
implementation was broken as written for Cygwin.
This finally showed up for me today as a failure in the new
in6addr-str test cases. By chance, I noticed at the same time
that tab completion in the listener was acting strangely on
packag prefix symbols; that issue also went away with
this fix.
* lib.c (cat_str, vscat, scat3, split_str_keep): We must use
wref on the array initialized using the wini macro, because on
Cygwin, the string starts at [1] not [0].
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -4810,7 +4810,7 @@ val cat_str(val list, val sep) struct cat_str cs; wchar_t onech[] = wini(" "); - cat_str_init(&cs, sep, onech, self); + cat_str_init(&cs, sep, wref(onech), self); for (iter = list; iter != nil; iter = cdr(iter)) cat_str_measure(&cs, car(iter), cdr(iter) != nil, self); @@ -4829,7 +4829,7 @@ static val vscat(val sep, va_list vl1, va_list vl2, val self) struct cat_str cs; wchar_t onech[] = wini(" "); - cat_str_init(&cs, sep, onech, self); + cat_str_init(&cs, sep, wref(onech), self); for (item = va_arg(vl1, val); item != nao; item = next) { @@ -4885,7 +4885,7 @@ val scat3(val s1, val sep, val s2) struct cat_str cs; wchar_t onech[] = wini(" "); - cat_str_init(&cs, sep, onech, self); + cat_str_init(&cs, sep, wref(onech), self); cat_str_measure(&cs, s1, 1, self); cat_str_measure(&cs, s2, 0, self); @@ -4961,7 +4961,7 @@ val split_str_keep(val str, val sep, val keep_sep) wchar_t onech[] = wini(" "); if (chrp(sep)) { - onech[0] = c_chr(sep); + wref(onech)[0] = c_chr(sep); len_sep = 1; sep = auto_str(coerce(const wchli_t *, wref(onech))); } else { |