changeset 5508:67db1f804162

(gud-common-init): Don't crash if no file specified.
author Richard M. Stallman <rms@gnu.org>
date Sat, 08 Jan 1994 12:18:55 +0000
parents 0a6c0e720ece
children 5d907d4216ce
files lisp/gud.el
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)