# HG changeset patch # User Roland McGrath # Date 717560820 0 # Node ID f882f7a19c604e9886b235ebd168db2849a1190b # Parent d4324e885a417aaa621691f9c4b9af781dda4faa (file-relative-name): Don't lose when DIRECTORY is nil. diff -r d4324e885a41 -r f882f7a19c60 lisp/files.el --- a/lisp/files.el Sun Sep 27 02:25:31 1992 +0000 +++ b/lisp/files.el Sun Sep 27 02:27:00 1992 +0000 @@ -940,7 +940,8 @@ (defun file-relative-name (filename &optional directory) "Convert FILENAME to be relative to DIRECTORY (default: default-directory)." (setq filename (expand-file-name filename) - directory (file-name-as-directory (or (expand-file-name directory) + directory (file-name-as-directory (if directory + (expand-file-name directory) default-directory))) (while (not (string-match (concat "^" (regexp-quote directory)) filename)) (setq directory (file-name-directory (substring directory 0 -1))))