Mercurial > emacs
diff src/w32.c @ 103811:5b3dd5ad8689
(stat): Treat UNC file names as residing on remote drives. (Bug#3542)
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Thu, 09 Jul 2009 18:44:14 +0000 |
parents | 9a76dfa56921 |
children | fe78cff95301 |
line wrap: on
line diff
--- a/src/w32.c Thu Jul 09 03:07:39 2009 +0000 +++ b/src/w32.c Thu Jul 09 18:44:14 2009 +0000 @@ -3347,11 +3347,13 @@ } } - /* 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);