| 5789 | |
| 5790 | #ifdef _WIN32 |
| 5791 | static wchar_t *cli_windows_utf8_to_wide(const char *value) { |
| 5792 | if (!value || !value[0]) { |
| 5793 | return NULL; |
| 5794 | } |
| 5795 | int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0); |
| 5796 | if (needed <= 0) { |
| 5797 | return NULL; |
| 5798 | } |
| 5799 | wchar_t *wide = malloc((size_t)needed * sizeof(*wide)); |
| 5800 | if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) { |
| 5801 | free(wide); |
| 5802 | return NULL; |
| 5803 | } |
| 5804 | return wide; |
| 5805 | } |
| 5806 | |
| 5807 | static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length, |
| 5808 | const wchar_t *directory) { |
no outgoing calls
no test coverage detected