diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-21 13:19:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-21 13:19:18 +0200 |
commit | 6520b63cb25580420e477cba2c776b2639cbf21b (patch) | |
tree | b166ff171780389a0f079ae587dd8cc75fb0d68e /cli/options.cxx | |
parent | 1dea398d6f864c99b9e1c34e4a718239cfd3d8ac (diff) |
Guarantee validity of values returned by scanner for two arguments
Diffstat (limited to 'cli/options.cxx')
-rw-r--r-- | cli/options.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/options.cxx b/cli/options.cxx index 43f271b..a59fb66 100644 --- a/cli/options.cxx +++ b/cli/options.cxx @@ -274,9 +274,9 @@ namespace cli return base::next (); else { - hold_.swap (args_.front ()); + hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ()); args_.pop_front (); - return hold_.c_str (); + return hold_[i_].c_str (); } } @@ -420,7 +420,7 @@ namespace cli { using namespace std; - string o (s.next ()); + const char* o (s.next ()); if (s.more ()) { |