From 88cbbbe29b18ae9fd00c20322dd9ef328251e6a4 Mon Sep 17 00:00:00 2001 From: computezrmle <57127745+computezrmle@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:16:07 +0100 Subject: [PATCH] Update vbox_vboxmanage.cpp Output from "vboxmanage -q list hdds" contains paths that are compared with the path of a file. Linux uses "/" as preferred directory separator while Windows uses "\". This patch ensures the compare delivers the same result on both platforms. --- samples/vboxwrapper/vbox_vboxmanage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp index 2b83fe6addb..1580b1f43db 100644 --- a/samples/vboxwrapper/vbox_vboxmanage.cpp +++ b/samples/vboxwrapper/vbox_vboxmanage.cpp @@ -16,6 +16,7 @@ // along with BOINC. If not, see . #ifdef _WIN32 +#include #include "boinc_win.h" #include "win_util.h" #else @@ -532,12 +533,20 @@ namespace vboxmanage { string medium_file = aid.project_dir; medium_file += "/" + multiattach_vdi_file; +#ifdef _WIN32 + replace(medium_file.begin(), medium_file.end(), '\\', '/'); +#endif + vboxlog_msg("Adding virtual disk drive to VM. (%s)", multiattach_vdi_file.c_str()); command = "list hdds"; retval = vbm_popen(command, output, "check if parent hdd is registered", false, false); if (retval) return retval; +#ifdef _WIN32 + replace(output.begin(), output.end(), '\\', '/'); +#endif + if (output.find(medium_file) == string::npos) { // parent hdd is not registered // vdi files can't be registered and set to multiattach mode within 1 step.