Fixed issue that could cause bogus arguments to be reported incorrectly

Examples:  'mame -whatever nes' would previously be reported as "Unrecognized argument: nes"
This commit is contained in:
Nathan Woods 2017-04-02 19:41:40 -04:00
parent e4741f5ac1
commit 44c04cd97a

View File

@ -361,13 +361,18 @@ bool core_options::parse_command_line(std::vector<std::string> &args, int priori
{
// we need to relocate this option
if (new_argc != arg)
args[new_argc++] = std::move(args[arg]);
args[new_argc] = std::move(args[arg]);
new_argc++;
if (!is_unadorned)
{
arg++;
if (new_argc != arg && arg < args.size())
args[new_argc++] = std::move(args[arg]);
if (arg < args.size())
{
if (new_argc != arg)
args[new_argc] = std::move(args[arg]);
new_argc++;
}
}
continue;
}