| 262 | /* ── Shared plumbing ────────────────────────────────────────────── */ |
| 263 | |
| 264 | static bool why_project_root(struct sqlite3 *db, const char *project, char *root, size_t root_cap) { |
| 265 | root[0] = '\0'; |
| 266 | sqlite3_stmt *st = NULL; |
| 267 | if (sqlite3_prepare_v2(db, "SELECT root_path FROM projects WHERE name=?1", -1, &st, NULL) != |
| 268 | SQLITE_OK) |
| 269 | return false; |
| 270 | sqlite3_bind_text(st, 1, project, -1, SQLITE_STATIC); |
| 271 | if (sqlite3_step(st) == SQLITE_ROW) { |
| 272 | const char *r = (const char *)sqlite3_column_text(st, 0); |
| 273 | if (r) |
| 274 | snprintf(root, root_cap, "%s", r); |
| 275 | } |
| 276 | sqlite3_finalize(st); |
| 277 | return root[0] != '\0'; |
| 278 | } |
| 279 | |
| 280 | static int why_edge_line(const char *properties_json) { |
| 281 | if (!properties_json) |
no outgoing calls
no test coverage detected