From e0c4c532845595dfda1c3f643d45ecba07ea739a Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 8 Nov 2014 13:57:33 +0000 Subject: [PATCH] Reject `-pkg.el` files with multi-line package descriptions See https://github.com/boyw165/hl-anything/issues/2 --- package-build.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index c4e82864..923c326c 100644 --- a/package-build.el +++ b/package-build.el @@ -708,14 +708,17 @@ Optionally PRETTY-PRINT the data." (when (file-exists-p file-path) (let ((package-def (pb/read-from-file file-path))) (if (eq 'define-package (car package-def)) - (let ((pkgfile-info (cdr package-def))) + (let* ((pkgfile-info (cdr package-def)) + (descr (nth 2 pkgfile-info))) + (when (string-match "[\r\n]" descr) + (error "Illegal multi-line package description")) (vector (nth 0 pkgfile-info) (mapcar (lambda (elt) (list (car elt) (version-to-list (cadr elt)))) (eval (nth 3 pkgfile-info))) - (nth 2 pkgfile-info) + descr (nth 1 pkgfile-info))) (error "No define-package found in %s" file-path)))))