OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_dataop.cpp versions 1.44 and 1.45
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_dataop.cpp 1.44 -> 1.45

--- as_dataop.cpp        2003/02/06 14:10:33     1.44
+++ as_dataop.cpp        2003/02/06 15:27:39     1.45
@@ -270,10 +270,10 @@
         Asline.skipWhiteSpace();    // Remove whitespaces
         Remark = Asline.read();     // Copy the remark field
 
-        QRegExp Quoted("\"(.*)[^\\]\"");            // Get rid of
-        Quoted.search(Remark);                      // surrounding double
-        Remark = Quoted.cap(Quoted.numCaptures());  // quotes, and
-        Remark.replace("\\(.)", "\1");              // escape backslashes
+        QRegExp Quoted("\"(.*[^\\\\])\"");                  // Get rid of
+        Quoted.search(Remark);                              // surrounding double
+        Remark = Quoted.cap(Quoted.numCaptures());          // quotes, and
+        Remark.replace(QRegExp("\\\\(.)"), QString("\\1")); // escape backslashes
 
         if (!Remark.isEmpty())
             m_pMaintable->setText(nIter, TITRAQ_IDXREMARK, Remark);
@@ -422,7 +422,9 @@
         if (Tempfield != NULL) {
             Strsearch = QRegExp::escape(Tempfield);                 // Incoming string escaped
             Stripper.search(Strsearch);
-            Tempfield.truncate(Stripper.pos());
+            Tempfield.truncate(Stripper.pos());                     // Cut off whitespace
+            Tempfield.replace(QChar('\\'), QString("\\\\"));        // Escape back slashes
+            Tempfield.replace(QChar('\"'), QString("\\\""));        // Escape double quotes
             Tstream << Tempfield;                                   // Save remark field text
         }
         Tstream << trUtf8("\"");                                    // Save ending double quote

CVSTrac 2.0.1