From 1b90adc1aa3652d130e0d0db1b415be2c2a1c619 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 26 Jun 2011 15:19:14 -0400 Subject: [PATCH] Bug - Fixed 'limit:N' bug, whereby when a report specifies a limit, and the user overrides it, there are potentially two limit arguments, in which case the last one, not the first one is needed. --- src/Arguments.cpp | 4 ++-- src/commands/CmdCustom.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Arguments.cpp b/src/Arguments.cpp index ff4aacacf..a240abaa8 100644 --- a/src/Arguments.cpp +++ b/src/Arguments.cpp @@ -673,8 +673,8 @@ bool Arguments::find_command (std::string& command) //////////////////////////////////////////////////////////////////////////////// std::string Arguments::find_limit () { - std::vector >::iterator arg; - for (arg = this->begin (); arg != this->end (); ++arg) + std::vector >::reverse_iterator arg; + for (arg = this->rbegin (); arg != this->rend (); ++arg) if (arg->first.find ("limit:") != std::string::npos) return arg->first.substr (6); diff --git a/src/commands/CmdCustom.cpp b/src/commands/CmdCustom.cpp index 12c31767a..d98571f02 100644 --- a/src/commands/CmdCustom.cpp +++ b/src/commands/CmdCustom.cpp @@ -25,7 +25,6 @@ // //////////////////////////////////////////////////////////////////////////////// -#include #include #include #include