From: Eli Zaretskii Date: Fri, 10 Jul 2009 08:48:11 +0000 (+0000) Subject: (stat): Treat UNC file names as residing on remote drives. (Bug#3542) X-Git-Tag: emacs-23.1~111 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=23bf60be7d3d59a13435f2fc0c5ba5f74ab24c64;p=emacs.git (stat): Treat UNC file names as residing on remote drives. (Bug#3542) --- diff --git a/src/w32.c b/src/w32.c index cd95f60e84f..a208b13a08d 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3154,11 +3154,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);