Commit b8f7f3be authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(Fexpand_file_name): Remove redundant tests. Fix elimination of // so that

it doesn't prevent elimination of an immediately following /. or /..
parent 0c91399a
2006-01-10 Stefan Monnier <monnier@iro.umontreal.ca>
* fileio.c (Fexpand_file_name): Remove redundant tests.
Fix elimination of // so that it doesn't prevent elimination of an
immediately following /. or /..
2006-01-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 2006-01-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
   
* gtkutil.c (xg_toggle_notify_cb): New function. * gtkutil.c (xg_toggle_notify_cb): New function.
......
/* File IO for GNU Emacs. /* File IO for GNU Emacs.
Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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. This file is part of GNU Emacs.
...@@ -1644,8 +1644,7 @@ See also the function `substitute-in-file-name'. */) ...@@ -1644,8 +1644,7 @@ See also the function `substitute-in-file-name'. */)
{ {
*o++ = *p++; *o++ = *p++;
} }
else if (IS_DIRECTORY_SEP (p[0]) else if (p[1] == '.'
&& p[1] == '.'
&& (IS_DIRECTORY_SEP (p[2]) && (IS_DIRECTORY_SEP (p[2])
|| p[2] == 0)) || p[2] == 0))
{ {
...@@ -1655,7 +1654,7 @@ See also the function `substitute-in-file-name'. */) ...@@ -1655,7 +1654,7 @@ See also the function `substitute-in-file-name'. */)
*o++ = *p; *o++ = *p;
p += 2; 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. /* `/../' is the "superroot" on certain file systems.
Turned off on DOS_NT systems because they have no Turned off on DOS_NT systems because they have no
"superroot" and because this causes us to produce "superroot" and because this causes us to produce
...@@ -1675,14 +1674,9 @@ See also the function `substitute-in-file-name'. */) ...@@ -1675,14 +1674,9 @@ See also the function `substitute-in-file-name'. */)
++o; ++o;
p += 3; p += 3;
} }
else if (p > target else if (p > target && IS_DIRECTORY_SEP (p[1]))
&& IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]))
{
/* Collapse multiple `/' in a row. */ /* Collapse multiple `/' in a row. */
*o++ = *p++; p++;
while (IS_DIRECTORY_SEP (*p))
++p;
}
else else
{ {
*o++ = *p++; *o++ = *p++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment