Make `shell-mode' more robust
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 28 Jun 2024 09:28:33 +0000 (11:28 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 28 Jun 2024 09:28:33 +0000 (11:28 +0200)
* lisp/shell.el (shell-mode): Ensure that
`comint-input-ring-file-name' is non-nil when calling `file-truename'.

lisp/shell.el

index 9399906715f035cfe60c790c7399215b7b05b99f..e1936ff111966803ebdb0603c6653d5056f8bfe0 100644 (file)
@@ -764,9 +764,10 @@ command."
              (setq-local comint-input-ring-size hsize))
         (setq comint-input-ring-file-name
               (concat remote hfile)))
-      (if (or (equal comint-input-ring-file-name "")
-             (equal (file-truename comint-input-ring-file-name)
-                    (file-truename null-device)))
+      (if (and comint-input-ring-file-name
+               (or (equal comint-input-ring-file-name "")
+                  (equal (file-truename comint-input-ring-file-name)
+                         (file-truename null-device))))
          (setq comint-input-ring-file-name nil))
       ;; Arrange to write out the input ring on exit, if the shell doesn't
       ;; do this itself.