[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: expand-file-name leaves "/../" in expansions at times

From: Chong Yidong
Subject: Re: expand-file-name leaves "/../" in expansions at times
Date: Mon, 16 Apr 2007 22:32:11 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux)

Diane Murray <address@hidden> writes:

> I have no idea if this is a bug or not, but sometimes
> `expand-file-name' returns a path with "/../" at the beginning of it.
> Below are a few simple examples.

C-h f expand-file-name RET

  expand-file-name is a built-in function in `C source code'.
  (expand-file-name name &optional default-directory)

  Convert filename name to absolute, and canonicalize it.
  Second arg default-directory is directory to start with if name is relative
  (does not start with slash); if default-directory is nil or missing,
  the current buffer's value of `default-directory' is used.

All your examples are consistent with this behavior.  The important
thing is that DEFAULT-DIRECTORY is only consulted if the filename is

Also, note that (/../ == /).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]