Explorar el Código

Merge pull request #1896 from meum/patch-1

Fix dot stuffing in SmtpClient
Miguel de Icaza hace 10 años
padre
commit
ccdf8c3274
Se han modificado 1 ficheros con 2 adiciones y 7 borrados
  1. 2 7
      mcs/class/System/System.Net.Mail/SmtpClient.cs

+ 2 - 7
mcs/class/System/System.Net.Mail/SmtpClient.cs

@@ -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);