win32 compilation fixes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2134 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2006-08-23 21:40:13 +00:00
parent 6b21b973ab
commit f45512feac
2 changed files with 23 additions and 32 deletions

15
block.c
View file

@ -182,11 +182,17 @@ void get_tmp_filename(char *filename, int size)
#endif
#ifdef _WIN32
static int is_windows_drive_prefix(const char *filename)
{
return (((filename[0] >= 'a' && filename[0] <= 'z') ||
(filename[0] >= 'A' && filename[0] <= 'Z')) &&
filename[1] == ':');
}
static int is_windows_drive(const char *filename)
{
if (((filename[0] >= 'a' && filename[0] <= 'z') ||
(filename[0] >= 'A' && filename[0] <= 'Z')) &&
filename[1] == ':' && filename[2] == '\0')
if (is_windows_drive_prefix(filename) &&
filename[2] == '\0')
return 1;
if (strstart(filename, "\\\\.\\", NULL) ||
strstart(filename, "//./", NULL))
@ -203,7 +209,8 @@ static BlockDriver *find_protocol(const char *filename)
const char *p;
#ifdef _WIN32
if (is_windows_drive(filename))
if (is_windows_drive(filename) ||
is_windows_drive_prefix(filename))
return &bdrv_raw;
#endif
p = strchr(filename, ':');