From 6479e8758d9b20736afce35c5e2b2b334c47593b Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 28 Jul 2023 18:35:20 +0200 Subject: [PATCH] ; 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. --- lisp/tar-mode.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -- 2.39.2