From c29eed174de09e1477ee31c87cf3e2f2dd445b9e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 15 Jul 2005 00:55:45 +0000 Subject: (process_options): Test the "i" and "arg" variables thoroughly before making use of either one of them. --- config.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config.cc b/config.cc index 885c37db..099162e8 100644 --- a/config.cc +++ b/config.cc @@ -182,10 +182,11 @@ void config_t::process_options(const std::string& command, if (*i == "--") break; - regexps_to_predicate(*this, command, arg, i++, true, - (command == "b" && ! show_subtotal && - display_predicate.empty())); - if (i != args_end) + if (i != arg) + regexps_to_predicate(*this, command, arg, i, true, + (command == "b" && ! show_subtotal && + display_predicate.empty())); + if (i != args_end && ++i != args_end) regexps_to_predicate(*this, command, i, args_end); } -- cgit v1.2.3