summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-10-12 13:58:17 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-10-12 13:58:17 (GMT)
commit22fca8aa12bb8308cb930d45bff0449163dc70ac (patch)
tree5f861cb5af4908216354aa218bd5f2315b2c8abf /Source/kwsys/SystemTools.cxx
parent48762a51dd157400a4dc5cb357d3f0e9e337b5cd (diff)
downloadCMake-22fca8aa12bb8308cb930d45bff0449163dc70ac.zip
CMake-22fca8aa12bb8308cb930d45bff0449163dc70ac.tar.gz
CMake-22fca8aa12bb8308cb930d45bff0449163dc70ac.tar.bz2
BUG: fix for bug 0005767 hang for replace string with empty
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx5
1 files changed, 5 insertions, 0 deletions
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;