From 22fca8aa12bb8308cb930d45bff0449163dc70ac Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 12 Oct 2007 09:58:17 -0400 Subject: BUG: fix for bug 0005767 hang for replace string with empty --- Source/kwsys/SystemTools.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index e878185..c2ded8c 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -455,6 +455,11 @@ void SystemTools::ReplaceString(kwsys_stl::string& source, // perform replacements until done size_t replaceSize = strlen(replace); + // do while hangs if replaceSize is 0 + if(replaceSize == 0) + { + return; + } char *orig = strdup(src); char *currentPos = orig; searchPos = searchPos - src + orig; -- cgit v0.12