Fix dot stuffing in SmtpClient
[mono.git] / mcs / class / System / System.Net.Mail / SmtpClient.cs
index 278e6e3426f83c0cf5c3b9d57cb971aa7a458f9d..ab1bde4ff7fd86789d37c22aa278abeb7f8cd0c1 100644 (file)
@@ -781,13 +781,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);