We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a30cc10 commit 3e1d260Copy full SHA for 3e1d260
include/boost/program_options/errors.hpp
@@ -26,7 +26,12 @@ namespace boost { namespace program_options {
26
inline std::string strip_prefixes(const std::string& text)
27
{
28
// "--foo-bar" -> "foo-bar"
29
- return text.substr(text.find_first_not_of("-/"));
+ std::string::size_type i = text.find_first_not_of("-/");
30
+ if (i == std::string::npos) {
31
+ return text;
32
+ } else {
33
+ return text.substr(i);
34
+ }
35
}
36
37
/** Base class for all errors in the library. */
0 commit comments