| 51 | } cv_proj_t; |
| 52 | |
| 53 | static bool cv_write(const char *root, const cv_file_t *file) { |
| 54 | char path[700]; |
| 55 | snprintf(path, sizeof(path), "%s/%s", root, file->name); |
| 56 | char *slash = strrchr(path, '/'); |
| 57 | if (slash && slash > path + strlen(root)) { |
| 58 | *slash = '\0'; |
| 59 | cbm_mkdir_p(path, 0755); |
| 60 | *slash = '/'; |
| 61 | } |
| 62 | FILE *f = cbm_fopen(path, "wb"); |
| 63 | if (!f) { |
| 64 | return false; |
| 65 | } |
| 66 | bool ok = fputs(file->content, f) >= 0; |
| 67 | return fclose(f) == 0 && ok; |
| 68 | } |
| 69 | |
| 70 | static bool cv_index(cv_proj_t *p, const cv_file_t *files, int count) { |
| 71 | memset(p, 0, sizeof(*p)); |
no test coverage detected