From 30bd5e964602ac3b95b11e01d1a52ef13c396bd7 Mon Sep 17 00:00:00 2001 From: schellingb <14200249+schellingb@users.noreply.github.com> Date: Mon, 9 Sep 2024 19:48:52 +0900 Subject: [PATCH] Support specifying command line arguments in AUTOBOOT.DBP (#531) --- dosbox_pure_run.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dosbox_pure_run.h b/dosbox_pure_run.h index 03272839..5b9e7dea 100644 --- a/dosbox_pure_run.h +++ b/dosbox_pure_run.h @@ -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') {