diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-02-16 09:30:20 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-02-16 09:30:20 -0800 |
commit | eb087dd466c11ea7526bef86be6874a038824ae6 (patch) | |
tree | 94f2306a260c7370403b4df7f2dbaa0aab8e05ad | |
parent | 068f93723d37b441234e2315d6c168aeb2854540 (diff) | |
download | txr-eb087dd466c11ea7526bef86be6874a038824ae6.tar.gz txr-eb087dd466c11ea7526bef86be6874a038824ae6.tar.bz2 txr-eb087dd466c11ea7526bef86be6874a038824ae6.zip |
sysrooting: trailing slash needed on directory.
* txr.c (sysroot_init): prog_dir is missing a trailing
slash, and this breaks the fallback case when we're running a
renamed txr executable in the build directory. The presence of
the trailing slash had also been documented for the txr-path
variable, which is now obsolescent and undocumented.
That is hereby fixed.
-rw-r--r-- | txr.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -290,6 +290,7 @@ static val sysroot(val target) static void sysroot_init(void) { val prog_dir; + const wchar_t *psc = wref(coerce(const wchar_t *, path_sep_chars)); #if HAVE_WINDOWS_H val slash = regex_compile(lit("\\\\"), nil); @@ -301,6 +302,9 @@ static void sysroot_init(void) #endif prog_dir = dir_name(prog_path); + if (ref(prog_dir, negone) != chr(psc[0])) + prog_dir = format(nil, lit("~a~a"), prog_dir, chr(psc[0]), nao); + if (!(maybe_sysroot(lit(TXR_REL_PATH)) || maybe_sysroot(lit(TXR_REL_PATH EXE_SUFF)) || maybe_sysroot(lit(PROG_NAME)) || |