From da64a3eeab26ddc1ebbe2d38054adce959375714 Mon Sep 17 00:00:00 2001 From: olegos2 <74909582+olegos2@users.noreply.github.com> Date: Thu, 28 Mar 2024 23:08:53 +0300 Subject: Add BOX64_RCFILE variable (#1392) * Implement BOX64_RCFILE * Update USAGE.md * Should fix tests --- src/core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 5bfc9810..187e5395 100644 --- a/src/core.c +++ b/src/core.c @@ -1559,18 +1559,22 @@ static void add_argv(const char* what) { static void load_rcfiles() { + char* rcpath = getenv("BOX64_RCFILE"); + + if(rcpath && FileExist(rcpath, IS_FILE)) + LoadRCFile(rcpath); #ifndef TERMUX - if(FileExist("/etc/box64.box64rc", IS_FILE)) + else if(FileExist("/etc/box64.box64rc", IS_FILE)) LoadRCFile("/etc/box64.box64rc"); else if(FileExist("/data/data/com.termux/files/usr/glibc/etc/box64.box64rc", IS_FILE)) LoadRCFile("/data/data/com.termux/files/usr/glibc/etc/box64.box64rc"); #else - if(FileExist("/data/data/com.termux/files/usr/etc/box64.box64rc", IS_FILE)) + else if(FileExist("/data/data/com.termux/files/usr/etc/box64.box64rc", IS_FILE)) LoadRCFile("/data/data/com.termux/files/usr/etc/box64.box64rc"); #endif - else LoadRCFile(NULL); // load default rcfile + char* p = getenv("HOME"); if(p) { char tmp[4096]; @@ -2177,4 +2181,4 @@ int emulate(x64emu_t* emu, elfheader_t* elf_header) #endif return ret; -} \ No newline at end of file +} -- cgit 1.4.1