Changed the base for relative configuration path from the EXE path to the current working directory at startup.
This commit is contained in:
7
src/pc.c
7
src/pc.c
@@ -368,6 +368,7 @@ pc_init(int argc, wchar_t *argv[])
|
|||||||
int c;
|
int c;
|
||||||
int cfgp = 0;
|
int cfgp = 0;
|
||||||
wchar_t cmdl_cfg_path[2048];
|
wchar_t cmdl_cfg_path[2048];
|
||||||
|
wchar_t emu_cwd[2048];
|
||||||
|
|
||||||
/* Grab the executable's full path. */
|
/* Grab the executable's full path. */
|
||||||
plat_get_exe_name(exe_path, sizeof(exe_path)-1);
|
plat_get_exe_name(exe_path, sizeof(exe_path)-1);
|
||||||
@@ -381,7 +382,7 @@ pc_init(int argc, wchar_t *argv[])
|
|||||||
* a shortcut (desktop icon), however, the CWD
|
* a shortcut (desktop icon), however, the CWD
|
||||||
* could have been set to something else.
|
* could have been set to something else.
|
||||||
*/
|
*/
|
||||||
plat_getcwd(cfg_path, sizeof(cfg_path)-1);
|
plat_getcwd(emu_cwd, sizeof(emu_cwd)-1);
|
||||||
|
|
||||||
for (c=1; c<argc; c++) {
|
for (c=1; c<argc; c++) {
|
||||||
if (argv[c][0] != L'-') break;
|
if (argv[c][0] != L'-') break;
|
||||||
@@ -452,10 +453,10 @@ usage:
|
|||||||
if (c != argc) goto usage;
|
if (c != argc) goto usage;
|
||||||
|
|
||||||
if (!cfgp) {
|
if (!cfgp) {
|
||||||
wcscpy(cfg_path, exe_path);
|
wcscpy(cfg_path, emu_cwd);
|
||||||
} else {
|
} else {
|
||||||
if ((cmdl_cfg_path[0] != L'\\') && (cmdl_cfg_path[0] != L'/') && (cmdl_cfg_path[1] != L':')) {
|
if ((cmdl_cfg_path[0] != L'\\') && (cmdl_cfg_path[0] != L'/') && (cmdl_cfg_path[1] != L':')) {
|
||||||
wcscpy(cfg_path, exe_path);
|
wcscpy(cfg_path, emu_cwd);
|
||||||
cfg_path_slash();
|
cfg_path_slash();
|
||||||
wcscat(cfg_path, cmdl_cfg_path);
|
wcscat(cfg_path, cmdl_cfg_path);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user