From a04f05bdd62fadd771e3e357dda468aa2b1f34e8 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 4 Dec 1997 04:39:00 +0000 Subject: [PATCH] (inferior-octave-directory-tracker): Anchor regexp match to beginning of command string. --- lisp/progmodes/octave-inf.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el index 5be9e94cc46..d026a06bb71 100644 --- a/lisp/progmodes/octave-inf.el +++ b/lisp/progmodes/octave-inf.el @@ -336,7 +336,7 @@ output is passed to the filter `inferior-octave-output-digest'." (defun inferior-octave-directory-tracker (string) "Tracks `cd' commands issued to the inferior Octave process. Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused." - (if (string-match "[ \t]*cd[ \t]*\\([^ \t\n;]*\\)[ \t\n;]" + (if (string-match "^[ \t]*cd[ \t]*\\([^ \t\n;]*\\)[ \t\n;]" string) (cd (substring string (match-beginning 1) (match-end 1))))) -- 2.39.2