diff options
author | Eli Zaretskii <eliz@gnu.org> | 2009-07-09 18:44:52 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2009-07-09 18:44:52 +0000 |
commit | fb8edc0bbd76abae0237a7a34291870b0dc9f2f7 (patch) | |
tree | 26a6578f0cf02bc6c2d44dfaa04121f18a89ca64 /src/w32.c | |
parent | 285284024b347508a7e05886f64090bfb4c99019 (diff) | |
download | emacs-fb8edc0bbd76abae0237a7a34291870b0dc9f2f7.tar.gz |
(stat): Treat UNC file names as residing on remote drives. (Bug#3542)
Diffstat (limited to 'src/w32.c')
-rw-r--r-- | src/w32.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); |