Merge pull request #1896 from meum/patch-1
authorMiguel de Icaza <miguel@gnome.org>
Tue, 22 Dec 2015 15:20:19 +0000 (10:20 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 22 Dec 2015 15:20:19 +0000 (10:20 -0500)
Fix dot stuffing in SmtpClient

mcs/class/System/System.Net.Mail/SmtpClient.cs

index 69fd3480999bf05ccbbc20a14f5290043c7626d6..bb6f93a048400ae68242ed19ca98aa64892b7946 100644 (file)
@@ -794,13 +794,8 @@ namespace System.Net.Mail {
                                CheckCancellation ();
 
                                if (escapeDots) {
-                                       int i;
-                                       for (i = 0; i < line.Length; i++) {
-                                               if (line[i] != '.')
-                                                       break;
-                                       }
-                                       if (i > 0 && i == line.Length) {
-                                               line += ".";
+                                       if (line.Length > 0 && line[0] == '.') {
+                                               line = "." + line;
                                        }
                                }
                                writer.Write (line);