summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-compat.el
diff options
context:
space:
mode:
authorSam Steingold <sds@gnu.org>2009-10-06 19:52:15 +0000
committerSam Steingold <sds@gnu.org>2009-10-06 19:52:15 +0000
commitf58f7520cd4b68e9ae5aebe2486d102c45cb6d7b (patch)
treebfdaed37ad7e2b19f268a853fa0d57d5e6c38241 /lisp/net/tramp-compat.el
parent9972911fda0c29ae1de4ab2d9a7fcac76545c9d1 (diff)
downloademacs-f58f7520cd4b68e9ae5aebe2486d102c45cb6d7b.tar.gz
(tramp-compat-process-running-p): Check that
the comm attribute is present before calling regexp-quote.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r--lisp/net/tramp-compat.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 258bc2f4de0..57f23df94f3 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -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.