Skip to content

Commit

Permalink
feat: add BOX86_RCFILE support (#960)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shenmo7192 authored Apr 30, 2024
1 parent 24f2c68 commit f5f1e14
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit f5f1e14

Please sign in to comment.