changeset 7430:1ec8830e553c

(file-chase-links): Delete redundant slashes. Match `..' only at start of string.
author Karl Heuer <kwzh@gnu.org>
date Tue, 10 May 1994 06:21:55 +0000
parents 5c2347e34b31
children a0f1b8c25adf
files lisp/files.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue May 10 05:58:57 1994 +0000
+++ b/lisp/files.el	Tue May 10 06:21:55 1994 +0000
@@ -381,11 +381,15 @@
     (while (setq tem (file-symlink-p newname))
       (if (= count 0)
 	  (error "Apparent cycle of symbolic links for %s" filename))
+      ;; In the context of a link, `//' doesn't mean what Emacs thinks.
+      (while (string-match "//+" tem)
+	(setq tem (concat (substring tem 0 (1+ (match-beginning 0)))
+			  (substring tem (match-end 0)))))
       ;; Handle `..' by hand, since it needs to work in the
       ;; target of any directory symlink.
       ;; This code is not quite complete; it does not handle
       ;; embedded .. in some cases such as ./../foo and foo/bar/../../../lose.
-      (while (string-match "\\.\\./" tem)
+      (while (string-match "\\`\\.\\./" tem)
 	(setq tem (substring tem 3))
 	(setq newname (file-name-as-directory
 		       ;; Do the .. by hand.