BUG: fix for bug 0005767 hang for replace string with empty

This commit is contained in:
Bill Hoffman 2007-10-12 09:58:17 -04:00
parent 48762a51dd
commit 22fca8aa12
1 changed files with 5 additions and 0 deletions

View File

@ -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;