| 5872 | |
| 5873 | #ifdef _WIN32 |
| 5874 | static wchar_t *cli_windows_utf8_to_wide(const char *value) { |
| 5875 | if (!value || !value[0]) { |
| 5876 | return NULL; |
| 5877 | } |
| 5878 | int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0); |
| 5879 | if (needed <= 0) { |
| 5880 | return NULL; |
| 5881 | } |
| 5882 | wchar_t *wide = malloc((size_t)needed * sizeof(*wide)); |
| 5883 | if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) { |
| 5884 | free(wide); |
| 5885 | return NULL; |
| 5886 | } |
| 5887 | return wide; |
| 5888 | } |
| 5889 | |
| 5890 | static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length, |
| 5891 | const wchar_t *directory) { |
no outgoing calls
no test coverage detected