updated for version 7.0065
diff --git a/src/eval.c b/src/eval.c
index 74f985a..7891fcf 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -5836,7 +5836,7 @@
 	    item = dict_find(d, key, -1);
 	    if (item != NULL)
 	    {
-		EMSG(_("E721: Duplicate key in Dictionary"));
+		EMSG2(_("E721: Duplicate key in Dictionary: \"%s\""), key);
 		clear_tv(&tvkey);
 		clear_tv(&tv);
 		goto failret;
@@ -11218,7 +11218,7 @@
     }
 
     filtd = 0;
-    while (cnt < maxline)
+    while (cnt < maxline || maxline < 0)
     {
 	readlen = fread(buf + filtd, 1, FREAD_SIZE - filtd, fd);
 	buflen = filtd + readlen;
@@ -11267,7 +11267,7 @@
 		li->li_tv.vval.v_string = s;
 		list_append(l, li);
 
-		if (++cnt >= maxline)
+		if (++cnt >= maxline && maxline >= 0)
 		    break;
 		if (readlen <= 0)
 		    break;
@@ -11307,6 +11307,17 @@
 	}
     }
 
+    /*
+     * For a negative line count use only the lines at the end of the file,
+     * free the rest.
+     */
+    if (maxline < 0)
+	while (cnt > -maxline)
+	{
+	    listitem_remove(l, l->lv_first);
+	    --cnt;
+	}
+
     vim_free(prev);
     fclose(fd);
 }