Read a small file through the UTF-8 path layer (wide on Windows), so a * non-ASCII path is never misread by the test's own ANSI CRT call. Returns the * byte count, or 0 when the file cannot be opened or is empty. */
| 338 | * non-ASCII path is never misread by the test's own ANSI CRT call. Returns the |
| 339 | * byte count, or 0 when the file cannot be opened or is empty. */ |
| 340 | static size_t read_small_file_utf8(const char *path, char *buf, size_t cap) { |
| 341 | buf[0] = '\0'; |
| 342 | FILE *fp = cbm_fopen(path, "rb"); |
| 343 | if (!fp) { |
| 344 | return 0; |
| 345 | } |
| 346 | size_t rd = fread(buf, 1, cap - 1, fp); |
| 347 | (void)fclose(fp); |
| 348 | buf[rd] = '\0'; |
| 349 | return rd; |
| 350 | } |
| 351 | |
| 352 | /* #1171: a repository (and a cache directory) under a non-ASCII path must |
| 353 | * export, report the artifact present, and import — also onto an existing |
no test coverage detected