From 097debb55a6914b3498d4894d0169eea2e92c876 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 20 Oct 2005 10:11:03 -0400 Subject: BUG: end is not really end, but rather length --- Source/cmStringCommand.cxx | 2 +- Source/cmStringCommand.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index eacbfed..aa24a02 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -555,7 +555,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& arg return false; } int leftOverLength = intStringLength - begin; - if ( end < 0 || end > intStringLength ) + if ( end < 0 || end > leftOverLength ) { cmOStringStream ostr; ostr << "end index: " << end << " is out of range " << 0 << " - " << leftOverLength; diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 8c6a11c..fc846d3 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -84,7 +84,7 @@ public: " STRING(TOUPPER )\n" " STRING(TOLOWER )\n" " STRING(LENGTH )\n" - " STRING(SUBSTRING )\n" + " STRING(SUBSTRING )\n" "REGEX MATCH will match the regular expression once and store the " "match in the output variable.\n" "REGEX MATCHALL will match the regular expression as many times as " -- cgit v0.12