]> git.eshelyaron.com Git - emacs.git/commitdiff
Add save-match-data to abbreviate-file-name (Bug#32201)
authorNoam Postavsky <npostavs@gmail.com>
Wed, 18 Jul 2018 22:45:47 +0000 (18:45 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sun, 22 Jul 2018 01:07:07 +0000 (21:07 -0400)
* lisp/files.el (abbreviate-file-name): Save match-data around
expand-file-name; it is not guaranteed to preserve match-data, and may
well do so depending on what file handlers and hooks are in effect.

lisp/files.el

index fb8c34bcae8a2bdbe30440dbb63fb93e1a4d6658..4eb1560a20de4d4d93e73588602295ec437d9c6a 100644 (file)
@@ -1929,7 +1929,7 @@ started Emacs, set `abbreviated-home-dir' to nil so it will be recalculated)."
                         (save-match-data
                           (string-match "^[a-zA-`]:/$" filename))))
                (equal (get 'abbreviated-home-dir 'home)
-                      (expand-file-name "~")))
+                      (save-match-data (expand-file-name "~"))))
          (setq filename
                (concat "~"
                        (match-string 1 filename)