MakeResDll crashes
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
The string_replace() function doesn't exit from while loop.
Here is the fix.
--- UnicodeString.cpp (revision 4536)
+++ UnicodeString.cpp (working copy)
@@ -28,9 +28,9 @@
void string_replace(String &target, const String &find, const String &replace)
{
const size_t replace_len = find.length();
- size_t prevPos = 0;
- size_t pos = target.find(find, prevPos);
- while (pos >= 0)
+ std::string::size_type prevPos = 0;
+ std::string::size_type pos = target.find(find, prevPos);
+ while (pos != std::string::npos)
{
target.replace(pos, replace_len, replace);
prevPos = pos;
Logged In: YES
user_id=631874
Originator: NO
Oh! That function was just a quick hack to get CString-style replace for MakeResDLL code conversion.. Thanks for finding and fixing this bug!
Patch also fixes weird crash I started seeing with ShellExtension while converting it. So please commit it when you can.
Logged In: YES
user_id=954028
Originator: YES
Committed to SVN trunk. Completed: At revision: 4540