summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-06-19 22:54:58 +0000
committerKarl Heuer <kwzh@gnu.org>1995-06-19 22:54:58 +0000
commit55ab860988567483b792e691f9a4cdf953ac15c5 (patch)
tree916847676053bc315b2cf0016f0f73db38d99a73 /lisp/shell.el
parente95fef1ec59d96f6e457255c2acbe0c351b199ca (diff)
downloademacs-55ab860988567483b792e691f9a4cdf953ac15c5.tar.gz
(shell-directory-tracker): Check for terminator after
cd, pushd, or popd, so that we don't try to do directory tracking on things like "cdump". Don't use \\s patterns inside brackets.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 2f297cb588d..abb580b47ff 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -450,20 +450,26 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(if shell-dirtrackp
;; We fail gracefully if we think the command will fail in the shell.
(condition-case chdir-failure
- (let ((start (progn (string-match "^[;\\s ]*" str) ; skip whitespace
+ (let ((start (progn (string-match "^[; \t]*" str) ; skip whitespace
(match-end 0)))
end cmd arg1)
(while (string-match shell-command-regexp str start)
(setq end (match-end 0)
cmd (comint-arguments (substring str start end) 0 0)
arg1 (comint-arguments (substring str start end) 1 1))
- (cond ((eq (string-match shell-popd-regexp cmd) 0)
+ (cond ((string-match (concat "\\`\\(" shell-popd-regexp
+ "\\)\\($\\|[ \t]\\)")
+ cmd)
(shell-process-popd (substitute-in-file-name arg1)))
- ((eq (string-match shell-pushd-regexp cmd) 0)
+ ((string-match (concat "\\`\\(" shell-pushd-regexp
+ "\\)\\($\\|[ \t]\\)")
+ cmd)
(shell-process-pushd (substitute-in-file-name arg1)))
- ((eq (string-match shell-cd-regexp cmd) 0)
+ ((string-match (concat "\\`\\(" shell-cd-regexp
+ "\\)\\($\\|[ \t]\\)")
+ cmd)
(shell-process-cd (substitute-in-file-name arg1))))
- (setq start (progn (string-match "[;\\s ]*" str end) ; skip again
+ (setq start (progn (string-match "[; \t]*" str end) ; skip again
(match-end 0)))))
(error "Couldn't cd"))))