Akihiko Odaki dfd3bb0a99 cutils: Fix get_relocated_path on Windows
get_relocated_path() did not have error handling for PathCchSkipRoot()
because a path given to get_relocated_path() was expected to be a valid
path containing a drive letter or UNC server/share path elements on
Windows, but sometimes it turned out otherwise.

The paths passed to get_relocated_path() are defined by macros generated
by Meson. Meson in turn uses a prefix given by the configure script to
generate them. For Windows, the script passes /qemu as a prefix to
Meson by default.

As documented in docs/about/build-platforms.rst, typically MSYS2 is used
for the build system, but it is also possible to use Linux as well. When
MSYS2 is used, its Bash variant recognizes /qemu as a MSYS2 path, and
converts it to a Windows path, adding the MSYS2 prefix including a drive
letter or UNC server/share path elements. Such a conversion does not
happen on a shell on Linux however, and /qemu will be passed as is in
the case.

Implement a proper error handling of PathCchSkipRoot() in
get_relocated_path() so that it can handle a path without a drive letter
or UNC server/share path elements.

Reported-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231005064726.6945-1-akihiko.odaki@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-10-19 23:13:27 +02:00
..
2023-05-30 17:37:26 +02:00
2023-03-20 12:43:50 +01:00
2023-08-31 19:47:43 +02:00
2023-05-23 15:20:15 +08:00
2023-03-20 12:43:50 +01:00
2023-09-07 20:32:11 -05:00
2022-04-21 17:03:51 +04:00
2023-08-31 19:47:43 +02:00
2023-04-24 11:29:00 +02:00
2020-12-10 17:16:44 +01:00
2023-08-31 19:47:43 +02:00
2022-06-29 10:56:12 +03:00
2023-10-17 15:20:53 +02:00
2023-08-31 19:47:43 +02:00
2023-02-02 11:48:20 +00:00
2023-03-28 15:23:10 -07:00
2023-08-31 19:47:43 +02:00
2023-04-27 16:39:43 +02:00
2023-10-04 18:15:06 -04:00
2021-04-01 15:27:44 +04:00