bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug with parent directories and symlinks


From: Trey Smith
Subject: bug with parent directories and symlinks
Date: Wed, 3 Mar 2004 17:11:04 -0500

This bug report concerns emacs version 21.2.1 on linux.

The problem relates to handling of parent directories in the presence of
symlinks.  The following section explains how to replicate the problem.

----------------------------------------------------------------------
Setup steps:

  cd /tmp
  mkdir -p foo/bar
  ln -s foo/bar bar
  echo 'this is my file' > foo/myfile
  cd bar

At this point we are in the "/tmp/foo/bar" directory, and there is a
file "/tmp/foo/myfile" which includes some text.  If we run emacs and
execute

  (find-file "../myfile")

Emacs will open "/tmp/myfile" instead of "/tmp/foo/myfile" as it should.
----------------------------------------------------------------------

This problem is particularly annoying when compiling C code under emacs,
because the compiler sometimes outputs header filenames in errors using
a relative path that includes "..", and attempting to jump to the file
containing the error fails.

The suggested fix is to not calculate ".." internally in emacs, but
instead to use the filesystem.  In the above example, opening
"/tmp/bar/../myfile" from the shell correctly yields "/tmp/foo/myfile".
Opening "/tmp/bar/../myfile" from emacs incorrectly yields "/tmp/myfile".

-Trey





reply via email to

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