summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-20 04:13:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-20 04:13:28 -0700
commit1b78b60d156e3c8593efdc04133131bfcaffaeab (patch)
treeafa0b7760f2449704ed7c6afa98e7592f3feccc0 /stream.c
parent3112ef90d63ebd48c3b203fce518f9b8d5900afa (diff)
downloadtxr-1b78b60d156e3c8593efdc04133131bfcaffaeab.tar.gz
txr-1b78b60d156e3c8593efdc04133131bfcaffaeab.tar.bz2
txr-1b78b60d156e3c8593efdc04133131bfcaffaeab.zip
bug: broken path handling on LIT_ALIGN == 2.
On platforms where wchar_t literals have two byte alignment, these misbehave incorrectly, failing to treat / as a path separator. Thus (dir-name "a/b/c") is reported as ".". Lack of test coverage, argh. * stream.c (base_name, dir_name): Do not use wref macro on wli() string literal; the offset is already built-in. * txr.c (sysroot_init): Likewise.
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 07a0060c..2aa3e833 100644
--- a/stream.c
+++ b/stream.c
@@ -4778,7 +4778,7 @@ val base_name(val path, val suff)
const wchar_t *wpath = c_str(path);
const wchar_t *end = wpath + c_num(length_str(path), self);
const wchar_t *rsep;
- const wchar_t *psc = wref(coerce(const wchar_t *, path_sep_chars));
+ const wchar_t *psc = coerce(const wchar_t *, path_sep_chars);
if (end == wpath)
return null_string;
@@ -4810,7 +4810,7 @@ val dir_name(val path)
val self = lit("dir-name");
const wchar_t *wpath = c_str(path);
const wchar_t *rsep = wpath + c_num(length_str(path), self);
- const wchar_t *psc = wref(coerce(const wchar_t *, path_sep_chars));
+ const wchar_t *psc = coerce(const wchar_t *, path_sep_chars);
if (rsep == wpath)
return lit(".");