Commit 71fe1fcc authored by Roland McGrath's avatar Roland McGrath
Browse files

(file-relative-name): Rewritten so unrelativizable file names win.

parent ea912aa6
......@@ -943,9 +943,17 @@ Value is a list whose car is the name for the backup file
directory (file-name-as-directory (if directory
(expand-file-name 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 "/")
((string-match (concat "^" (regexp-quote directory))
(substring filename (match-end 0)))
(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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment