SCP: Added default simulator specific initialization file to be in the current working directory if one isn't found where the simulator binary is located (suggested by Jordi Guillaumes Pons in #101).
This commit is contained in:
parent
fcaced5393
commit
18451806b7
1 changed files with 10 additions and 1 deletions
11
scp.c
11
scp.c
|
@ -921,7 +921,16 @@ else if (*argv[0]) { /* sim name arg? */
|
||||||
if ((np = match_ext (nbuf, "EXE"))) /* remove .exe */
|
if ((np = match_ext (nbuf, "EXE"))) /* remove .exe */
|
||||||
*np = 0;
|
*np = 0;
|
||||||
strcat (nbuf, ".ini\""); /* add .ini" */
|
strcat (nbuf, ".ini\""); /* add .ini" */
|
||||||
stat = do_cmd (-1, nbuf); /* proc cmd file */
|
stat = do_cmd (-1, nbuf) & ~SCPE_NOMESSAGE; /* proc default cmd file */
|
||||||
|
if (stat == SCPE_OPENERR) { /* didn't exist/can't open? */
|
||||||
|
np = strrchr (nbuf, '/'); /* stript path and try again in cwd */
|
||||||
|
if (np == NULL)
|
||||||
|
np = strrchr (nbuf, '\\');
|
||||||
|
if (np != NULL) {
|
||||||
|
*np = '"';
|
||||||
|
stat = do_cmd (-1, np) & ~SCPE_NOMESSAGE; /* proc default cmd file */
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stat = SCPE_BARE_STATUS(stat); /* remove possible flag */
|
stat = SCPE_BARE_STATUS(stat); /* remove possible flag */
|
||||||
|
|
Loading…
Add table
Reference in a new issue