comparison src/fileio.c @ 83455:8438f5473d99

Merged from miles@gnu.org--gnu-2005 (patch 174-181, 685-690) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-685 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-686 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-687 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-688 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-689 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-174 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-175 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-176 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-177 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-178 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-179 Update from CVS: texi/gnus.texi (RSS): Addition. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-180 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-181 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-495
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 12 Jan 2006 11:20:02 +0000
parents c82829d08b89 8b817a6ceff5
children 3cc2ba972850
comparison
equal deleted inserted replaced
83454:845a93c68e9a 83455:8438f5473d99
1 /* File IO for GNU Emacs. 1 /* File IO for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996,
3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc. 4 2005, 2006 Free Software Foundation, Inc.
5 5
6 This file is part of GNU Emacs. 6 This file is part of GNU Emacs.
7 7
8 GNU Emacs is free software; you can redistribute it and/or modify 8 GNU Emacs is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
1644 #else /* not VMS */ 1644 #else /* not VMS */
1645 if (!IS_DIRECTORY_SEP (*p)) 1645 if (!IS_DIRECTORY_SEP (*p))
1646 { 1646 {
1647 *o++ = *p++; 1647 *o++ = *p++;
1648 } 1648 }
1649 else if (IS_DIRECTORY_SEP (p[0]) 1649 else if (p[1] == '.'
1650 && p[1] == '.'
1651 && (IS_DIRECTORY_SEP (p[2]) 1650 && (IS_DIRECTORY_SEP (p[2])
1652 || p[2] == 0)) 1651 || p[2] == 0))
1653 { 1652 {
1654 /* If "/." is the entire filename, keep the "/". Otherwise, 1653 /* If "/." is the entire filename, keep the "/". Otherwise,
1655 just delete the whole "/.". */ 1654 just delete the whole "/.". */
1656 if (o == target && p[2] == '\0') 1655 if (o == target && p[2] == '\0')
1657 *o++ = *p; 1656 *o++ = *p;
1658 p += 2; 1657 p += 2;
1659 } 1658 }
1660 else if (IS_DIRECTORY_SEP (p[0]) && p[1] == '.' && p[2] == '.' 1659 else if (p[1] == '.' && p[2] == '.'
1661 /* `/../' is the "superroot" on certain file systems. 1660 /* `/../' is the "superroot" on certain file systems.
1662 Turned off on DOS_NT systems because they have no 1661 Turned off on DOS_NT systems because they have no
1663 "superroot" and because this causes us to produce 1662 "superroot" and because this causes us to produce
1664 file names like "d:/../foo" which fail file-related 1663 file names like "d:/../foo" which fail file-related
1665 functions of the underlying OS. (To reproduce, try a 1664 functions of the underlying OS. (To reproduce, try a
1675 /* Keep initial / only if this is the whole name. */ 1674 /* Keep initial / only if this is the whole name. */
1676 if (o == target && IS_ANY_SEP (*o) && p[3] == 0) 1675 if (o == target && IS_ANY_SEP (*o) && p[3] == 0)
1677 ++o; 1676 ++o;
1678 p += 3; 1677 p += 3;
1679 } 1678 }
1680 else if (p > target 1679 else if (p > target && IS_DIRECTORY_SEP (p[1]))
1681 && IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1])) 1680 /* Collapse multiple `/' in a row. */
1682 { 1681 p++;
1683 /* Collapse multiple `/' in a row. */
1684 *o++ = *p++;
1685 while (IS_DIRECTORY_SEP (*p))
1686 ++p;
1687 }
1688 else 1682 else
1689 { 1683 {
1690 *o++ = *p++; 1684 *o++ = *p++;
1691 } 1685 }
1692 #endif /* not VMS */ 1686 #endif /* not VMS */