diff options
| author | olegos2 <74909582+olegos2@users.noreply.github.com> | 2024-03-28 23:08:53 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 21:08:53 +0100 |
| commit | da64a3eeab26ddc1ebbe2d38054adce959375714 (patch) | |
| tree | a344815fa705d23c3a4ae15c36dcc4f9eeb3395c /src | |
| parent | 912622bf1f3db7f3cba32b44f4f1c106e3fb7dbf (diff) | |
| download | box64-da64a3eeab26ddc1ebbe2d38054adce959375714.tar.gz box64-da64a3eeab26ddc1ebbe2d38054adce959375714.zip | |
Add BOX64_RCFILE variable (#1392)
* Implement BOX64_RCFILE * Update USAGE.md * Should fix tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 12 |
1 files changed, 8 insertions, 4 deletions
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 +} |