From a8322d0b022f1354f08946bf0c32096b1573810c Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Mon, 14 Jan 2002 18:35:21 +0000 Subject: [PATCH] _stat: Better test for drive letter. --- dlls/msvcrt/file.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index daf3128ba2f..7e3e75ad9e9 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -957,9 +957,13 @@ int _stat(const char* path, struct _stat * buf) memset(buf,0,sizeof(struct _stat)); - /* FIXME: rdev isnt drive num,despite what the docs say-what is it? */ - if (isalpha(*path)) - buf->st_dev = buf->st_rdev = toupper(*path - 'A'); /* drive num */ + /* FIXME: rdev isnt drive num,despite what the docs say-what is it? + Bon 011120: This fixme seems incorrect + Also a letter as first char isn't enough to be classify + as drive letter + */ + if (isalpha(*path)&& (*(path+1)==':')) + buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */ else buf->st_dev = buf->st_rdev = _getdrive() - 1;