summaryrefslogtreecommitdiff
path: root/Source/cmGetFilenameComponentCommand.cxx
diff options
context:
space:
mode:
authorJames Johnston <johnstonj.public@codenest.com>2015-08-05 00:33:59 -0400
committerJames Johnston <johnstonj.public@codenest.com>2015-08-06 17:53:34 +0000
commitd035e9687a2d28e2f64ec3a316f8abea57e49d63 (patch)
treed17e6d3fab9852d80996ef0909c1aa58421761ac /Source/cmGetFilenameComponentCommand.cxx
parent38ed5866ed212effe0217f193f728ee54ea7378b (diff)
downloadcmake-d035e9687a2d28e2f64ec3a316f8abea57e49d63.tar.gz
get_filename_component: Fix bug where CACHE was ignored.
If PROGRAM_ARGS is provided to get_filename_component, fix bug where the command failed to honor the CACHE argument. Added test cases to RunCMake.get_filename_component that fail when the bug is not fixed to prevent regressions. Signed-off-by: James Johnston <johnstonj.public@codenest.com>
Diffstat (limited to 'Source/cmGetFilenameComponentCommand.cxx')
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index 67f9f2dc17..13a9afbe73 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -24,7 +24,7 @@ bool cmGetFilenameComponentCommand
// Check and see if the value has been stored in the cache
// already, if so use that value
- if(args.size() == 4 && args[3] == "CACHE")
+ if(args.size() >= 4 && args[args.size() - 1] == "CACHE")
{
const char* cacheValue = this->Makefile->GetDefinition(args[0]);
if(cacheValue && !cmSystemTools::IsNOTFOUND(cacheValue))
@@ -111,7 +111,7 @@ bool cmGetFilenameComponentCommand
return false;
}
- if(args.size() == 4 && args[3] == "CACHE")
+ if(args.size() >= 4 && args[args.size() - 1] == "CACHE")
{
if(!programArgs.empty() && !storeArgs.empty())
{