# HG changeset patch # User Richard M. Stallman # Date 758031535 0 # Node ID 67db1f804162f8eba6974659f83436d1288ffd1b # Parent 0a6c0e720ece765febf6e820927d31e20527b709 (gud-common-init): Don't crash if no file specified. diff -r 0a6c0e720ece -r 67db1f804162 lisp/gud.el --- a/lisp/gud.el Sat Jan 08 11:48:18 1994 +0000 +++ b/lisp/gud.el Sat Jan 08 12:18:55 1994 +0000 @@ -809,14 +809,15 @@ (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)