# HG changeset patch # User Stefan Monnier # Date 1136915201 0 # Node ID 8b817a6ceff5969d933db21e777dab9fa846997d # Parent 340b01243a62dc352b06ec31bca96fe3510693ba (Fexpand_file_name): Remove redundant tests. Fix elimination of // so that it doesn't prevent elimination of an immediately following /. or /.. diff -r 340b01243a62 -r 8b817a6ceff5 src/ChangeLog --- a/src/ChangeLog Tue Jan 10 14:06:14 2006 +0000 +++ b/src/ChangeLog Tue Jan 10 17:46:41 2006 +0000 @@ -1,3 +1,9 @@ +2006-01-10 Stefan Monnier + + * 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 * gtkutil.c (xg_toggle_notify_cb): New function. diff -r 340b01243a62 -r 8b817a6ceff5 src/fileio.c --- a/src/fileio.c Tue Jan 10 14:06:14 2006 +0000 +++ b/src/fileio.c Tue Jan 10 17:46:41 2006 +0000 @@ -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 @@ { *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 @@ *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 @@ ++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++;