bc5dde
diff -up bind-9.5.0b1/bin/dig/dighost.c.libidn3 bind-9.5.0b1/bin/dig/dighost.c
bc5dde
--- bind-9.5.0b1/bin/dig/dighost.c.libidn3	2007-12-20 13:24:27.000000000 +0100
bc5dde
+++ bind-9.5.0b1/bin/dig/dighost.c	2007-12-20 13:27:10.000000000 +0100
bc5dde
@@ -1859,10 +1859,13 @@ setup_lookup(dig_lookup_t *lookup) {
bc5dde
 	if (lookup->origin != NULL) {
bc5dde
 		result = libidn_locale_to_utf8 (lookup->origin->origin, utf8_str);
bc5dde
 		check_result (result, "convert origin to UTF-8");
bc5dde
-		if (len + strlen (utf8_str) < MXNAME)
bc5dde
-			(void) strcpy (utf8_name + len, utf8_str);
bc5dde
-		else
bc5dde
-			fatal ("Too long name + origin");
bc5dde
+		if (len > 0 && utf8_name[len - 1] != '.') {
bc5dde
+			utf8_name[len++] = '.';
bc5dde
+			if (len + strlen (utf8_str) < MXNAME)
bc5dde
+				(void) strcpy (utf8_name + len, utf8_str);
bc5dde
+			else
bc5dde
+				fatal ("Too long name + origin");
bc5dde
+		}
bc5dde
 	}
bc5dde
 
bc5dde
 	result = libidn_utf8_to_ascii (utf8_name, ascii_name);