diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-01-10 17:46:41 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-01-10 17:46:41 +0000 |
commit | b8f7f3be80c182ea4b6f112eb1e1193ed78233eb (patch) | |
tree | 666b16988c9f0618d6157b20bb5b7a63185055c0 /src/fileio.c | |
parent | 0c91399adf347632b904936403b07f23206db27f (diff) | |
download | emacs-b8f7f3be80c182ea4b6f112eb1e1193ed78233eb.tar.gz emacs-b8f7f3be80c182ea4b6f112eb1e1193ed78233eb.tar.bz2 emacs-b8f7f3be80c182ea4b6f112eb1e1193ed78233eb.zip |
(Fexpand_file_name): Remove redundant tests. Fix elimination of // so that
it doesn't prevent elimination of an immediately following /. or /..
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/fileio.c b/src/fileio.c index fb56c62b78a..66546b3b556 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,7 +1,7 @@ /* File IO for GNU Emacs. Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1644,8 +1644,7 @@ See also the function `substitute-in-file-name'. */) { *o++ = *p++; } - else if (IS_DIRECTORY_SEP (p[0]) - && p[1] == '.' + else if (p[1] == '.' && (IS_DIRECTORY_SEP (p[2]) || p[2] == 0)) { @@ -1655,7 +1654,7 @@ See also the function `substitute-in-file-name'. */) *o++ = *p; p += 2; } - else if (IS_DIRECTORY_SEP (p[0]) && p[1] == '.' && p[2] == '.' + else if (p[1] == '.' && p[2] == '.' /* `/../' is the "superroot" on certain file systems. Turned off on DOS_NT systems because they have no "superroot" and because this causes us to produce @@ -1675,14 +1674,9 @@ See also the function `substitute-in-file-name'. */) ++o; p += 3; } - else if (p > target - && IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1])) - { - /* Collapse multiple `/' in a row. */ - *o++ = *p++; - while (IS_DIRECTORY_SEP (*p)) - ++p; - } + else if (p > target && IS_DIRECTORY_SEP (p[1])) + /* Collapse multiple `/' in a row. */ + p++; else { *o++ = *p++; |