From d1ab689de800eb4a7d66306c96d9dd4f502cf4e5 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 29 Sep 2011 10:39:44 +0200 Subject: [PATCH] * util/misc.c (grub_util_get_disk_size) [__MINGW32__]: Strip trailing slashes on PHYSICALDRIVE%d paths when making Windows CreateFile calls. --- ChangeLog | 5 +++++ util/misc.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index bc5508d32..df31ef3e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-29 Mario Limonciello + + * util/misc.c (grub_util_get_disk_size) [__MINGW32__]: Strip trailing + slashes on PHYSICALDRIVE%d paths when making Windows CreateFile calls. + 2011-09-29 Mario Limonciello * grub-core/kern/emu/misc.c (canonicalize_file_name) [__MINGW32__]: Use diff --git a/util/misc.c b/util/misc.c index e4425358a..72bedde0c 100644 --- a/util/misc.c +++ b/util/misc.c @@ -55,6 +55,7 @@ #ifdef __MINGW32__ #include #include +#include "dirname.h" #endif #ifdef GRUB_UTIL @@ -322,6 +323,7 @@ grub_util_get_disk_size (char *name) HANDLE hd; grub_int64_t size = -1LL; + strip_trailing_slashes(name); hd = CreateFile (name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);