From 605eb397fc9f6480f22c7002db16d8770197535c Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 5 Jul 2009 00:06:41 -0400 Subject: [PATCH] Bug Fix - Fixed bug whereby rc: and rc. processing ignored the -- argument. --- src/Context.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 4ea02a7ea..1eac06b1d 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -309,13 +309,17 @@ void Context::loadCorrectConfigFile () // Is there an override for rc? foreach (arg, args) - if (arg->substr (0, 3) == "rc:") + { + if (*arg == "--") + break; + else if (arg->substr (0, 3) == "rc:") { rc = arg->substr (3, std::string::npos); args.erase (arg); header ("Using alternate .taskrc file " + rc); // TODO i18n break; } + } // Load rc file. config.clear (); // Dump current values. @@ -327,12 +331,16 @@ void Context::loadCorrectConfigFile () // Is there an override for data? foreach (arg, args) - if (arg->substr (0, 17) == "rc.data.location:") + { + if (*arg == "--") + break; + else if (arg->substr (0, 17) == "rc.data.location:") { data = arg->substr (17, std::string::npos); header ("Using alternate data.location " + data); // TODO i18n break; } + } // Do we need to create a default rc? if (access (rc.c_str (), F_OK) && @@ -356,7 +364,9 @@ void Context::loadCorrectConfigFile () std::vector filtered; foreach (arg, args) { - if (arg->substr (0, 3) == "rc.") + if (*arg == "--") + break; + else if (arg->substr (0, 3) == "rc.") { std::string name; std::string value;