From 1ef28a6ba81120c13135e28b32c8ae6e20c4a219 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 16 Jun 2018 18:59:43 -0400 Subject: [PATCH] Detect a non-list package archive content properly (Bug#22311) * lisp/emacs-lisp/package.el (package--download-one-archive): Use `read' instead of `read-from-string'; the latter always returns a cons, so the `listp' check on its return value doesn't make sense. It was changed from `read' to `read-from-string' in 2015-04-01 "* emacs-lisp/package.el: Implement asynchronous refreshing", but that change was not needed because `read' works fine on strings as well as buffers. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c56502236e..576a9bc7e7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1532,7 +1532,7 @@ package--download-one-archive (content (buffer-string)) (dir (expand-file-name (format "archives/%s" name) package-user-dir)) (local-file (expand-file-name file dir))) - (when (listp (read-from-string content)) + (when (listp (read content)) (make-directory dir t) (if (or (not package-check-signature) (member name package-unsigned-archives)) -- 2.11.0