From: Basil L. Contovounesios Date: Fri, 28 Jul 2023 16:35:20 +0000 (+0200) Subject: ; Avoid recent tar-mode.el constant mutation X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6479e8758d9b20736afce35c5e2b2b334c47593b;p=emacs.git ; Avoid recent tar-mode.el constant mutation * lisp/tar-mode.el (tar-attr-vector): Initialize with fresh vector to avoid constant vector mutation (bug#64686). (tar-parse-pax-extended-header): Use fillarray. --- diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index e4ea95343e0..2b6329fecc3 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -255,15 +255,14 @@ Only attributes that `tar-mode' can grok are mentioned.") (decode-coding-string str coding) str)) -(defvar tar-attr-vector '[nil nil nil nil nil nil nil nil]) +(defvar tar-attr-vector (make-vector 8 nil)) (defun tar-parse-pax-extended-header (pos) "Parse a pax external header of a Posix-format tar file." (let ((end (+ pos 512)) (result tar-attr-vector) (coding 'utf-8-unix) attr value record-len value-len) - (dotimes (i 8) - (aset result i nil)) + (fillarray result nil) (goto-char pos) (while (and (< pos end) (re-search-forward pax-extended-attribute-record-regexp