[Spice-devel] [PATCH spice-gtk 35/44] fixup! usb-redir: add implementation of emulated CD device

Frediano Ziglio fziglio at redhat.com
Tue Jul 30 12:03:22 UTC 2019


Improve is_device_name for Windows.
---
 src/usb-device-cd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c
index bc1c60d3..9554a82f 100644
--- a/src/usb-device-cd.c
+++ b/src/usb-device-cd.c
@@ -194,8 +194,8 @@ static int cd_device_check(SpiceCdLU *unit)
 
 static gboolean is_device_name(const char *filename)
 {
-    gboolean b = strlen(filename) == 2 && filename[1] == ':';
-    return b;
+    return g_ascii_isalpha(filename[0]) && filename[1] == ':' &&
+        filename[2] == 0;
 }
 
 static HANDLE open_file(const char *filename)
-- 
2.20.1



More information about the Spice-devel mailing list