diff options
author | Richard M. Stallman <[email protected]> | 1994-01-08 12:18:55 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1994-01-08 12:18:55 +0000 |
commit | 52b85866affc31bbade8eb2c49ebdc9f18858e80 (patch) | |
tree | a5d255a68e1d95a4e971a34b92f00fb5db5c8dac /lisp | |
parent | 84fa8eb54bcf68969c02cd84f7735ae2a77fc2af (diff) |
(gud-common-init): Don't crash if no file specified.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/gud.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/gud.el b/lisp/gud.el index d8544e8d87..fac1ae1570 100644 --- a/lisp/gud.el +++ b/lisp/gud.el @@ -809,14 +809,15 @@ comint mode, which see." (setq w (cdr w))) (car w))) (args (delq file-word (cdr words))) - (file (expand-file-name (substitute-in-file-name file-word))) - (filepart (file-name-nondirectory file))) + (file (and file-word + (expand-file-name (substitute-in-file-name file-word)))) + (filepart (and file-word (file-name-nondirectory file)))) (switch-to-buffer (concat "*gud-" filepart "*")) - (setq default-directory (file-name-directory file)) + (and file-word (setq default-directory (file-name-directory file))) (or (bolp) (newline)) (insert "Current directory is " default-directory "\n") (apply 'make-comint (concat "gud-" filepart) program nil - (gud-massage-args file args))) + (if file-word (gud-massage-args file args)))) (gud-mode) (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter) (set-process-sentinel (get-buffer-process (current-buffer)) 'gud-sentinel) |