| 56 | } |
| 57 | |
| 58 | static void write_file_at(const char *rel_path, const char *content) { |
| 59 | char path[512]; |
| 60 | snprintf(path, sizeof(path), "%s/%s", g_repodir, rel_path); |
| 61 | char dir[512]; |
| 62 | snprintf(dir, sizeof(dir), "%s", path); |
| 63 | char *slash = strrchr(dir, '/'); |
| 64 | if (slash) { |
| 65 | *slash = '\0'; |
| 66 | cbm_mkdir(dir); |
| 67 | } |
| 68 | FILE *f = fopen(path, "w"); |
| 69 | if (f) { |
| 70 | fputs(content, f); |
| 71 | fclose(f); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | static void delete_file_at(const char *rel_path) { |
| 76 | char path[512]; |
no test coverage detected