| 5851 | |
| 5852 | #ifdef _WIN32 |
| 5853 | static wchar_t *cli_windows_utf8_to_wide(const char *value) { |
| 5854 | if (!value || !value[0]) { |
| 5855 | return NULL; |
| 5856 | } |
| 5857 | int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0); |
| 5858 | if (needed <= 0) { |
| 5859 | return NULL; |
| 5860 | } |
| 5861 | wchar_t *wide = malloc((size_t)needed * sizeof(*wide)); |
| 5862 | if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) { |
| 5863 | free(wide); |
| 5864 | return NULL; |
| 5865 | } |
| 5866 | return wide; |
| 5867 | } |
| 5868 | |
| 5869 | static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length, |
| 5870 | const wchar_t *directory) { |
no outgoing calls
no test coverage detected