canonicalize, canonicalize-lgpl: support MS-Windows file names
authorEli Zaretskii <eliz@gnu.org>
Tue, 20 Nov 2012 21:47:22 +0000 (13:47 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Nov 2012 21:47:37 +0000 (13:47 -0800)
commit86627bb14a123f183bd094e582e4cd9f2aca489a
treeb0b9576047d94092a2f8afe573fb15b266eeb9a1
parentfd9f1acededd74f8cd095e657528aa8fad183536
canonicalize, canonicalize-lgpl: support MS-Windows file names

See <http://lists.gnu.org/archive/html/bug-gnulib/2012-11/msg00074.html>
for test cases, which it'd be nice to add at some point.
* lib/canonicalize.c, lib/canonicalize-lgpl.c: Include dosname.h.
* lib/canonicalize.c (canonicalize_filename_mode):
* lib/canonicalize-lgpl.c (__realpath):
Use FILE_SYSTEM_PREFIX_LEN instead of assuming that the first
slash is at the beginning of the file name.  Use ISSLASH, instead
of a literal '/'.  Use IS_ABSOLUTE_FILE_NAME instead of comparing
the first character with '/'.  Test for
DOUBLE_SLASH_IS_DISTINCT_ROOT only if the file name does not begin
with a drive letter.
* lib/canonicalize.c (SLASHES): New macro.
(canonicalize_filename_mode): Use SLASHES instead of a literal "/".
ChangeLog
lib/canonicalize-lgpl.c
lib/canonicalize.c