The Folder of a directory entry: plain, or `proj.pkg.base/` when a file * beside it shares the stem (cbm_stem_marks_t). */
| 2244 | /* The Folder of a directory entry: plain, or `proj.pkg.base/` when a file |
| 2245 | * beside it shares the stem (cbm_stem_marks_t). */ |
| 2246 | static const cbm_gbuf_node_t *kustomize_folder(const cbm_pipeline_ctx_t *ctx, const char *path) { |
| 2247 | char *fqn = cbm_pipeline_fqn_folder(ctx->project_name, path); |
| 2248 | if (!fqn) { |
| 2249 | return NULL; |
| 2250 | } |
| 2251 | const cbm_gbuf_node_t *n = cbm_gbuf_find_by_qn(ctx->gbuf, fqn); |
| 2252 | if (!n || !n->label || strcmp(n->label, "Folder") != 0) { |
| 2253 | char marked[PKGMAP_PATH_BUF]; |
| 2254 | int len = snprintf(marked, sizeof(marked), "%s/", fqn); |
| 2255 | n = len > 0 && (size_t)len < sizeof(marked) ? cbm_gbuf_find_by_qn(ctx->gbuf, marked) : NULL; |
| 2256 | } |
| 2257 | free(fqn); |
| 2258 | return n && n->label && strcmp(n->label, "Folder") == 0 ? n : NULL; |
| 2259 | } |
| 2260 | |
| 2261 | /* A kustomization entry is a path relative to the kustomization's own |
| 2262 | * directory -- a manifest file or a directory -- or a remote base; it never |
no test coverage detected