aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer1995-06-19 22:54:58 +0000
committerKarl Heuer1995-06-19 22:54:58 +0000
commit5402169506a60e77d12259c5a68769c47d5d4e9c (patch)
treeeeead1988ecd7c9537316ed0329fe96418b8ef70 /lisp
parent9478941d7bea114cc0c9ba4f955eb882ba568875 (diff)
downloademacs-5402169506a60e77d12259c5a68769c47d5d4e9c.tar.gz
emacs-5402169506a60e77d12259c5a68769c47d5d4e9c.zip
(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')
-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'."
450 (if shell-dirtrackp 450 (if shell-dirtrackp
451 ;; We fail gracefully if we think the command will fail in the shell. 451 ;; We fail gracefully if we think the command will fail in the shell.
452 (condition-case chdir-failure 452 (condition-case chdir-failure
453 (let ((start (progn (string-match "^[;\\s ]*" str) ; skip whitespace 453 (let ((start (progn (string-match "^[; \t]*" str) ; skip whitespace
454 (match-end 0))) 454 (match-end 0)))
455 end cmd arg1) 455 end cmd arg1)
456 (while (string-match shell-command-regexp str start) 456 (while (string-match shell-command-regexp str start)
457 (setq end (match-end 0) 457 (setq end (match-end 0)
458 cmd (comint-arguments (substring str start end) 0 0) 458 cmd (comint-arguments (substring str start end) 0 0)
459 arg1 (comint-arguments (substring str start end) 1 1)) 459 arg1 (comint-arguments (substring str start end) 1 1))
460 (cond ((eq (string-match shell-popd-regexp cmd) 0) 460 (cond ((string-match (concat "\\`\\(" shell-popd-regexp
461 "\\)\\($\\|[ \t]\\)")
462 cmd)
461 (shell-process-popd (substitute-in-file-name arg1))) 463 (shell-process-popd (substitute-in-file-name arg1)))
462 ((eq (string-match shell-pushd-regexp cmd) 0) 464 ((string-match (concat "\\`\\(" shell-pushd-regexp
465 "\\)\\($\\|[ \t]\\)")
466 cmd)
463 (shell-process-pushd (substitute-in-file-name arg1))) 467 (shell-process-pushd (substitute-in-file-name arg1)))
464 ((eq (string-match shell-cd-regexp cmd) 0) 468 ((string-match (concat "\\`\\(" shell-cd-regexp
469 "\\)\\($\\|[ \t]\\)")
470 cmd)
465 (shell-process-cd (substitute-in-file-name arg1)))) 471 (shell-process-cd (substitute-in-file-name arg1))))
466 (setq start (progn (string-match "[;\\s ]*" str end) ; skip again 472 (setq start (progn (string-match "[; \t]*" str end) ; skip again
467 (match-end 0))))) 473 (match-end 0)))))
468 (error "Couldn't cd")))) 474 (error "Couldn't cd"))))
469 475