[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Bug in ResText with double backslashes

From: <vss2svn_at_nogga.de>
Date: 2006-02-03 22:04:14 CET

Hi again,

there is another bug in ResText when translating strings containing
backslashes. The backslash is not converted into a double backslash and
therefore the msgmerge utility will fail.

Attached is a small fix
Best regards
Dirk

Index: C:/src/tortoiseSVN/src/ResText/Utils.cpp
===================================================================
--- C:/src/tortoiseSVN/src/ResText/Utils.cpp (revision 5619)
+++ C:/src/tortoiseSVN/src/ResText/Utils.cpp (working copy)
@@ -29,7 +29,20 @@
 void CUtils::StringExtend(LPTSTR str)
 {
     TCHAR * cPos = str;
- do
+ do
+ {
+ cPos = _tcschr(cPos, '\\');
+ if (cPos)
+ {
+ memmove(cPos+1, cPos, _tcslen(cPos)*sizeof(TCHAR));
+ *cPos = '\\';
+ *(cPos+1) = '\\';
+ cPos++;
+ cPos++;
+ }
+ } while (cPos != NULL);
+ cPos = str;
+ do
     {
         cPos = _tcschr(cPos, '\n');
         if (cPos)
@@ -104,10 +117,12 @@
                 *cPos = '"';
                 memmove(cPos+1, cPos+2, (_tcslen(cPos+2)+1)*sizeof(TCHAR));
             }
- else
- {
- cPos++;
- }
+ else if (*(cPos+1) == '\\')
+ {
+ *cPos = '\\';
+ memmove(cPos+1, cPos+2, (_tcslen(cPos+2)+1)*sizeof(TCHAR));
+ }
+ cPos++;
         }
     } while (cPos != NULL);
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Fri Feb 3 22:05:03 2006

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.