| 6682 | |
| 6683 | #ifdef _WIN32 |
| 6684 | static wchar_t *cli_windows_utf8_to_wide(const char *value) { |
| 6685 | if (!value || !value[0]) { |
| 6686 | return NULL; |
| 6687 | } |
| 6688 | int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0); |
| 6689 | if (needed <= 0) { |
| 6690 | return NULL; |
| 6691 | } |
| 6692 | wchar_t *wide = malloc((size_t)needed * sizeof(*wide)); |
| 6693 | if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) { |
| 6694 | free(wide); |
| 6695 | return NULL; |
| 6696 | } |
| 6697 | return wide; |
| 6698 | } |
| 6699 | |
| 6700 | static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length, |
| 6701 | const wchar_t *directory) { |
no outgoing calls
no test coverage detected