summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-07-21 07:54:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-07-21 07:54:25 -0700
commitdd385954ec30b2dbdb8fe4dd6c7a5907cf752faa (patch)
treef182f4f07e99996a23c333dd9aa20d1d81a2aeab
parent35a0332d1dcf2dbd743e5a24cc6f7d2b15fb8b8c (diff)
downloadtxr-dd385954ec30b2dbdb8fe4dd6c7a5907cf752faa.tar.gz
txr-dd385954ec30b2dbdb8fe4dd6c7a5907cf752faa.tar.bz2
txr-dd385954ec30b2dbdb8fe4dd6c7a5907cf752faa.zip
syrooting: remove two useless checks.
* txr.c (sysroot_init): The value of TXR_REL_PATH already has the exe suffix on it if we are building for Windows. There is no need to try with EXE_SUFF tacked on to it. There is also no need to try PROG_NAME with or without the suffix. EXE_SUFF is the empty string on non-Windows platforms, so the two lines of code are equivalent. On Windows, PROG_NAME without the EXE_SUFF will not match; that maybe_sysroot call is a waste of CPU cycles.
-rw-r--r--txr.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/txr.c b/txr.c
index 36750a8e..8fab8eae 100644
--- a/txr.c
+++ b/txr.c
@@ -335,10 +335,8 @@ static void sysroot_init(void)
prog_dir = scat3(prog_dir, chr(psc[0]), null_string);
if (!(maybe_sysroot(lit(TXR_REL_PATH)) ||
- maybe_sysroot(lit(TXR_REL_PATH EXE_SUFF)) ||
maybe_sysroot(substitute_basename(lit(TXR_REL_PATH), prog_path)) ||
(share_txr_stdlib = 0) ||
- maybe_sysroot(lit(PROG_NAME)) ||
maybe_sysroot(lit(PROG_NAME EXE_SUFF))))
{
sysroot_path = prog_dir;