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

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

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


From: Diane Murray
Subject: expand-file-name leaves "/../" in expansions at times
Date: Tue, 17 Apr 2007 03:20:10 +0200

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.

It looks like it might have to do with whether there is an even or odd
number of "../" - with an odd amount it seems to return the correct
path, but not with even numbers - and it does the opposite when
there's a "/" at the beginning of the path to expand.

(expand-file-name "../home/" "/")
"/../home/"

(expand-file-name "/../home/" "/usr/")
"/../home/"

(expand-file-name "/../../home/" "/usr/")
"/home/"

(expand-file-name "../../../../../home/" "/usr/")
"/home/"

(expand-file-name "../../../../../../home/" "/usr/")
"/../home/"

(expand-file-name "/home/../../../usr/" "/usr/")
"/usr/"

(expand-file-name "/home/../../usr/" "/usr/")
"/../usr/"

(expand-file-name "/home/../..//../../usr/" "/usr/")
"/../usr/"

(expand-file-name "/home/..//../../usr/" "/usr/")
"/usr/"


In GNU Emacs 22.0.97.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2007-04-14 on spargel
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40300000
configured using `configure  '--prefix=/usr/local/emacs-cvs/2007-04-14' 
'--program-suffix=-cvs''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.ISO_8859-1
  locale-coding-system: iso-8859-1
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
<left> <left> <left> <left> <left> <left> <left> C-j 
C-e <return> <return> ( e x <escape> / <escape> / SPC 
" / h o m e / <backspace> <backspace> <backspace> <backspace> 
<backspace> . . / h o m e / " S-SPC " / u s r / " ) 
C-j <up> <up> C-e <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> h o m e / <right> 
<right> <right> C-d C-d C-d C-d u s r C-e C-j <up> 
<up> C-e <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
. . / C-e C-j <up> <up> <up> <up> <up> <up> <up> <up> 
<up> C-e <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
/ C-e C-j <up> <up> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> C-d <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <left> . . / C-e C-j <up> <up> C-SPC 
C-e M-w <down> <down> <S-insert> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> C-d C-d C-e 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> C-e C-j <up> 
<up> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <left> C-d 
C-e C-j <escape> x r e o p <tab> <backspace> <backspace> 
p o <tab> r <tab> <return>

Recent messages:
("emacs-cvs" "-Q")
For information about the GNU Project and its goals, type C-h C-p.
Mark set [2 times]
Loading dabbrev...done
Mark set [2 times]
Making completion list...
Loading help-mode...done
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done




reply via email to

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