From ee9199b4e0fe5c5aef205e5b7f0886778c5dd650 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 22 Jul 2011 00:31:54 -0400 Subject: [PATCH] Bug - Fixed bug where the command line was incorrectly scanned, looking for 'cal', '/cal', 'calendar' or '/calendar'. --- src/Arguments.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Arguments.cpp b/src/Arguments.cpp index cbc7de062..286748d1f 100644 --- a/src/Arguments.cpp +++ b/src/Arguments.cpp @@ -324,10 +324,11 @@ void Arguments::categorize () { arg->_third = "program"; // TODO Is this a problem for expressions that do not contain a program name? - if (arg->_first == "cal" || - arg->_first == "calendar" || - arg->_first.find ("/calendar") == arg->_first.length () - 9 || - arg->_first.find ("/cal") == arg->_first.length () - 4) + + if ((arg->_first.length () >= 3 && + arg->_first.substr (arg->_first.length () - 3) == "cal") || + (arg->_first.length () >= 8 && + arg->_first.substr (arg->_first.length () - 8) == "calendar")) { arg->_first = "calendar"; arg->_third = "command";