# HG changeset patch # User Roland McGrath # Date 717561649 0 # Node ID f1090e9652443581de13a91eec604782e0506dba # Parent f882f7a19c604e9886b235ebd168db2849a1190b (file-relative-name): Rewritten so unrelativizable file names win. diff -r f882f7a19c60 -r f1090e965244 lisp/files.el --- a/lisp/files.el Sun Sep 27 02:27:00 1992 +0000 +++ b/lisp/files.el Sun Sep 27 02:40:49 1992 +0000 @@ -943,9 +943,17 @@ 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)))) - (substring filename (match-end 0))) + (let ((strip (lambda (directory) + (cond ((string= directory "/") + filename) + ((string-match (concat "^" (regexp-quote directory)) + filename) + (substring filename (match-end 0))) + (t + (funcall strip + (file-name-directory (substring directory + 0 -1)))))))) + (funcall strip directory))) (defun save-buffer (&optional args) "Save current buffer in visited file if modified. Versions described below.