Merge pull request #1896 from meum/patch-1
[mono.git] / 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);