Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23529/src/mail

Modified Files:
        MailFolderCC.cpp 
Log Message:
fixed bug with slashes and colons not working in login names (893)

Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.699
retrieving revision 1.700
diff -b -u -2 -r1.699 -r1.700
--- MailFolderCC.cpp    29 Apr 2004 11:09:37 -0000      1.699
+++ MailFolderCC.cpp    12 May 2004 21:54:20 -0000      1.700
@@ -1269,5 +1269,36 @@
       else if ( !login.empty() )
       {
-         spec << _T("/user=") << login;
+         spec << _T("/user=");
+
+         // we need to quote the user name if it contains slashes or colons
+         // which have special meaning in remote spec for c-client
+         bool needQuotes = false;
+         String loginQuoted;
+         const size_t len = login.length();
+         for ( size_t n = 0; n < len; n++ )
+         {
+            const wxChar ch = login[n];
+            if ( ch == _T(':') || ch == _T('/') )
+            {
+               // were we already quoting before?
+               if ( !needQuotes )
+               {
+                  // no, but we do need to quote
+                  loginQuoted.reserve(len + 2);
+                  loginQuoted.assign(login, 0, n);
+                  needQuotes = true;
+               }
+
+               loginQuoted += _T('\\');
+            }
+
+            if ( needQuotes )
+               loginQuoted += ch;
+         }
+
+         if ( needQuotes )
+            spec << _T('"') << loginQuoted << _T('"');
+         else
+            spec << login;
       }
       //else: we'll ask the user about his login later



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to