From 6b0f8d6833e611b7816975e10e0d26e57596bbfc Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 19 Apr 2019 19:28:55 +0000 Subject: [PATCH] Strip leading = from value. Can happen if you execute "irq =5". Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4209 --- src/misc/programs.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/misc/programs.cpp b/src/misc/programs.cpp index 12ffcb86..df65122c 100644 --- a/src/misc/programs.cpp +++ b/src/misc/programs.cpp @@ -719,9 +719,14 @@ void CONFIG::Run(void) { // Input has been parsed (pvar[0]=section, [1]=property, [2]=value) // now execute Section* tsec = control->GetSection(pvars[0]); - std::string value; - value += pvars[2]; + std::string value(pvars[2]); + //Due to parsing there can be a = at the start of value. + while (value.size() && (value.at(0) ==' ' ||value.at(0) =='=') ) value.erase(0,1); for(Bitu i = 3; i < pvars.size(); i++) value += (std::string(" ") + pvars[i]); + if (value.empty() ) { + WriteOut(MSG_Get("PROGRAM_CONFIG_SET_SYNTAX")); + return; + } std::string inputline = pvars[1] + "=" + value; tsec->ExecuteDestroy(false);