diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-23 21:40:13 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-23 21:40:13 +0000 |
commit | f45512feac6622615e08cca33d172abb87b01921 (patch) | |
tree | b07fd7452ccda48a7b0b77740420cc2c11c0abaa /block.c | |
parent | 6b21b973ab9aa2bfc3ebfe1df4474466ceb4d88b (diff) | |
download | qemu-f45512feac6622615e08cca33d172abb87b01921.zip qemu-f45512feac6622615e08cca33d172abb87b01921.tar.gz qemu-f45512feac6622615e08cca33d172abb87b01921.tar.bz2 |
win32 compilation fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2134 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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, ':'); |