(setq tem argval)
(setq tem (car command-line-args-left)
command-line-args-left (cdr command-line-args-left)))
+ (setq tem (command-line-normalize-file-name tem))
(setq extra-load-path
(cons (expand-file-name tem) extra-load-path))
(setq load-path (append (nreverse extra-load-path)
(setq tem argval)
(setq tem (car command-line-args-left)
command-line-args-left (cdr command-line-args-left)))
- (let ((file tem))
+ (let ((file (command-line-normalize-file-name tem)))
;; Take file from default dir if it exists there;
;; otherwise let `load' search for it.
(if (file-exists-p (expand-file-name file))
command-line-args-left (cdr command-line-args-left)))
(or (stringp tem)
(error "File name omitted from `-insert' option"))
- (insert-file-contents tem))
+ (insert-file-contents (command-line-normalize-file-name tem)))
((string-equal argi "-kill")
(kill-emacs t))
((string-match "^\\+[0-9]+\\'" argi)
(if (string-match "\\`-" argi)
(error "Unknown option `%s'" argi))
(setq file-count (1+ file-count))
+ (setq argi (command-line-normalize-file-name argi))
(cond ((= file-count 1)
(setq first-file-buffer
(find-file (expand-file-name argi dir))))
(progn (other-window 1)
(buffer-menu)))))))
+(defun command-line-normalize-file-name (file)
+ "Collapse multiple slashes to one, to handle non-Emacs file names."
+ (while (string-match "//+" file)
+ (setq file (replace-match "/" t t file)))
+ file)
+
;;; startup.el ends here