]> git.eshelyaron.com Git - emacs.git/commitdiff
(tramp-compat-process-running-p): Check that
authorSam Steingold <sds@gnu.org>
Tue, 6 Oct 2009 19:52:15 +0000 (19:52 +0000)
committerSam Steingold <sds@gnu.org>
Tue, 6 Oct 2009 19:52:15 +0000 (19:52 +0000)
the comm attribute is present before calling regexp-quote.

lisp/ChangeLog
lisp/net/tramp-compat.el

index 77482ef548a6769be1b26aeddc46bff43fad238b..123af6d961399be8005e61dddb846bfdeb8c4935 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-06  Sam Steingold  <sds@gnu.org>
+
+       * net/tramp-compat.el (tramp-compat-process-running-p): Check that
+       the comm attribute is present before calling regexp-quote.
+
 2009-10-06  Juanma Barranquero  <lekktu@gmail.com>
 
        * play/animate.el (animate-string): For good effect, make sure
index 258bc2f4de016e1bfd598c002fce4a79570c0b10..57f23df94f3f9f4d462f4eb2d9110a820773e0dc 100644 (file)
@@ -312,15 +312,15 @@ element is not omitted."
        (dolist (pid (funcall (symbol-function 'list-system-processes)) result)
          (let ((attributes
                 (funcall (symbol-function 'process-attributes) pid)))
-           (when
-               (and (string-equal
-                     (cdr (assoc 'user attributes)) (user-login-name))
-                    ;; The returned command name could be truncated
-                    ;; to 15 characters.  Therefore, we cannot check
-                    ;; for `string-equal'.
-                    (string-match
-                     (concat "^" (regexp-quote (cdr (assoc 'comm attributes))))
-                     process-name))
+           (when (and (string-equal
+                        (cdr (assoc 'user attributes)) (user-login-name))
+                       (let ((comm (cdr (assoc 'comm attributes))))
+                         ;; The returned command name could be truncated
+                         ;; to 15 characters.  Therefore, we cannot check
+                         ;; for `string-equal'.
+                         (and comm (string-match
+                                    (concat "^" (regexp-quote comm))
+                                    process-name))))
              (setq result t))))))
 
      ;; Fallback, if there is no Lisp support yet.