feat: add BOX86_RCFILE support (#960)

* feat: try add BOX86_RCFILE support

Make box86 support _RCFILE env like box64
https://github.com/ptitSeb/box64/blob/main/src/core.c#L1595

* adjust: comment rcfile loading to avoid crash
This commit is contained in:
shenmo 2024-04-30 20:30:38 +08:00 committed by GitHub
parent 24f2c68805
commit f5f1e1413d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1202,17 +1202,24 @@ static void add_argv(const char* what) {
static void load_rcfiles()
{
char* rcpath = getenv("BOX86_RCFILE");
if(rcpath && FileExist(rcpath, IS_FILE))
LoadRCFile(rcpath);
#ifndef TERMUX
if(FileExist("/etc/box86.box86rc", IS_FILE))
else if(FileExist("/etc/box86.box86rc", IS_FILE))
LoadRCFile("/etc/box86.box86rc");
#else
if(FileExist("/data/data/com.termux/files/usr/etc/box86.box86rc", IS_FILE))
else if(FileExist("/data/data/com.termux/files/usr/etc/box86.box86rc", IS_FILE))
LoadRCFile("/data/data/com.termux/files/usr/etc/box86.box86rc");
#endif
#ifdef PANDORA
if(FileExist("/mnt/utmp/codeblocks/usr/etc/box86.box86rc", IS_FILE))
else if(FileExist("/mnt/utmp/codeblocks/usr/etc/box86.box86rc", IS_FILE))
LoadRCFile("/mnt/utmp/codeblocks/usr/etc/box86.box86rc");
#endif
// else
// LoadRCFile(NULL); // load default rcfile
char* p = getenv("HOME");
if(p) {
char tmp[4096];