Skip to content

Commit

Permalink
Support specifying command line arguments in AUTOBOOT.DBP (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
schellingb committed Sep 9, 2024
1 parent 67f6dc9 commit 30bd5e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dosbox_pure_run.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,14 @@ struct DBP_Run
*p = '\0'; // for strcmp/atoi/DOS_FileExists/assign
if (line_no == 1)
{
const char linetype = (line[1] == '*' ? line[0] : 0), *str = line + (linetype ? 2 : 0);
char linetype = (line[1] == '*' ? line[0] : 0), *str = line + (linetype ? 2 : 0);
if (linetype == 0)
{
if (DOS_FileExists(str)) { autoboot.startup.mode = RUN_EXEC; autoboot.startup.exec.assign(str); }
char *param = strchr(str, ' ');
if (param) *param = '\0';
bool exists = DOS_FileExists(str);
if (param) *param = ' ';
if (exists) { autoboot.startup.mode = RUN_EXEC; autoboot.startup.exec.assign(str); }
}
else if (linetype == 'O' || linetype == 'S' || linetype == 'V')
{
Expand Down

0 comments on commit 30bd5e9

Please sign in to comment.