changeset 6116:6bc2995619f3 HEAD

domain-literal parsing should have skipped LWSP after it.
author Timo Sirainen <tss@iki.fi>
date Fri, 20 Jul 2007 08:28:26 +0300
parents 35d12c0cd7a7
children 9214044ce1f1
files src/lib-mail/rfc822-parser.c
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/rfc822-parser.c	Fri Jul 20 08:31:06 2007 +0300
+++ b/src/lib-mail/rfc822-parser.c	Fri Jul 20 08:28:26 2007 +0300
@@ -308,7 +308,7 @@
 		} else if (*ctx->data == ']') {
 			ctx->data++;
 			str_append_n(str, start, ctx->data - start);
-			return ctx->data != ctx->end;
+			return rfc822_skip_lwsp(ctx);
 		}
 	}
 
@@ -329,13 +329,8 @@
 	if (rfc822_skip_lwsp(ctx) <= 0)
 		return -1;
 
-	if (*ctx->data == '[') {
-		if (rfc822_parse_domain_literal(ctx, str) < 0)
-			return -1;
-	} else {
-		if (rfc822_parse_dot_atom(ctx, str) < 0)
-			return -1;
-	}
-
-	return ctx->data != ctx->end;
+	if (*ctx->data == '[')
+		return rfc822_parse_domain_literal(ctx, str);
+	else
+		return rfc822_parse_dot_atom(ctx, str);
 }