| 161 | } sp_proj_t; |
| 162 | |
| 163 | static bool sp_write(const char *root, const char *name, const char *content) { |
| 164 | char path[700]; |
| 165 | snprintf(path, sizeof(path), "%s/%s", root, name); |
| 166 | char *slash = strrchr(path, '/'); |
| 167 | if (slash && slash > path + strlen(root)) { |
| 168 | *slash = '\0'; |
| 169 | cbm_mkdir_p(path, 0755); |
| 170 | *slash = '/'; |
| 171 | } |
| 172 | FILE *f = cbm_fopen(path, "wb"); |
| 173 | if (!f) { |
| 174 | return false; |
| 175 | } |
| 176 | bool ok = fputs(content, f) >= 0; |
| 177 | return fclose(f) == 0 && ok; |
| 178 | } |
| 179 | |
| 180 | /* Index `files`, plus `pad` trivial Python files (enough of them moves the |
| 181 | * index onto the parallel resolver, MIN_FILES_FOR_PARALLEL). */ |
no test coverage detected