File kdepim-trinity-patch1.patch of Package kdepim3
--- kdepim-3.5.13.1.orig/libkmime/kmime_util.cpp 2012-09-08 12:06:45.000000000 +0200
+++ kdepim-3.5.13.1/libkmime/kmime_util.cpp 2012-09-25 18:49:54.806551812 +0200
@@ -436,29 +436,25 @@
void removeQuots(QCString &str)
{
- str.replace(QRegExp("\\\""), "\"");
- str.replace(QRegExp("\\\\"), "\\");
+ // Removes any quote or backslash caracter
+ str.replace(QRegExp("[\\\"]"), "");
}
void removeQuots(QString &str)
{
- str.replace(QRegExp("\\\""), "\"");
- str.replace(QRegExp("\\\\"), "\\");
+ // Removes any quote or backslash caracter
+ str.replace(QRegExp("[\\\"]"), "");
}
void addQuotes(QCString &str, bool forceQuotes)
{
- bool needsQuotes=false;
- if ( QString( str ) .contains( QRegExp( QString( "\"|\\\\|=|\\]|\\[|:|;|,|\\.|,|@|<|>|\\)|\\(" ) ) ) )
- needsQuotes = true;
-
- str.replace(QRegExp("\\"), "\\\\");
- str.replace(QRegExp("\""), "\\\"");
-
- if (needsQuotes || forceQuotes) {
- str.insert(0,'\"');
+ if ( forceQuotes || QString(str).contains( QRegExp( QString( "\"|\\\\|=|\\]|\\[|:|;|,|\\.|,|@|<|>|\\)|\\(" ) ) ) ) {
+ // Adds a backslash in front of any existing quote or backslash character
+ str.replace(QRegExp("([\\\"])"), "\\\\1");
+ // Adds quote at beginning and end of thestring
+ str.insert(0,'"');
str.append("\"");
}
}