From: Eli Zaretskii Date: Thu, 9 Jul 2009 18:44:52 +0000 (+0000) Subject: (stat): Treat UNC file names as residing on remote drives. (Bug#3542) X-Git-Tag: emacs-pretest-23.1.90~2243 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fb8edc0bbd76abae0237a7a34291870b0dc9f2f7;p=emacs.git (stat): Treat UNC file names as residing on remote drives. (Bug#3542) --- diff --git a/src/ChangeLog b/src/ChangeLog index fec0b8ec0cd..e64812b43a8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-07-09 Eli Zaretskii + + * w32.c (stat): Treat UNC file names as residing on remote + drives. (Bug#3542) + 2009-07-09 Kenichi Handa * fontset.c (fontset_find_font): Fix previous change. diff --git a/src/w32.c b/src/w32.c index ef0272259c4..2a7be366aec 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3347,11 +3347,13 @@ stat (const char * path, struct stat * buf) } } - /* GetDriveType needs the root directory of NAME's drive. */ - if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) - devtype = GetDriveType (NULL); /* use root of current diectory */ + if (IS_DIRECTORY_SEP (name[0]) && IS_DIRECTORY_SEP (name[1])) + devtype = DRIVE_REMOTE; /* assume UNC name is remote */ + else if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) + devtype = GetDriveType (NULL); /* use root of current drive */ else { + /* GetDriveType needs the root directory of NAME's drive. */ strncpy (drive_root, name, 3); drive_root[3] = '\0'; devtype = GetDriveType (drive_root);