summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/options.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2017-02-26 09:08:20 -0500
committer Vas Crabb <cuavas@users.noreply.github.com>2017-02-27 01:14:11 +1100
commit239dcd44490c467c31c7d0c51da5fefdfec8d9f6 (patch)
tree3510ce185b24ab2d0aaec66f2e623c6c8a217113 /src/lib/util/options.cpp
parent4b9648e7cd7cae926c4b088b8a5840cd1364ec1c (diff)
Fixed regression pertaining to specification of empty strings as slot names
e.g. - 'next -scsibus:1 "" -listdevices'
Diffstat (limited to 'src/lib/util/options.cpp')
-rw-r--r--src/lib/util/options.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp
index a7d59dee105..3f255188625 100644
--- a/src/lib/util/options.cpp
+++ b/src/lib/util/options.cpp
@@ -486,7 +486,7 @@ bool core_options::parse_ini_file(util::core_file &inifile, int priority, int ig
// value from within a command line
//-------------------------------------------------
-std::string core_options::pluck_from_command_line(std::vector<std::string> &args, const std::string &optionname)
+bool core_options::pluck_from_command_line(std::vector<std::string> &args, const std::string &optionname, std::string &result)
{
// find this entry within the options (it is illegal to call this with a non-existant option
// so we assert if not present)
@@ -504,7 +504,6 @@ std::string core_options::pluck_from_command_line(std::vector<std::string> &args
}
// find each of the targets in the argv array
- std::string result;
for (int i = 1; i < args.size() - 1; i++)
{
auto const iter = std::find_if(
@@ -519,10 +518,12 @@ std::string core_options::pluck_from_command_line(std::vector<std::string> &args
// remove this arguments from the list
auto const pos = std::next(args.begin(), i);
args.erase(pos, std::next(pos, 2));
- break;
+ return true;
}
}
- return result;
+
+ result.clear();
+ return false;
}