From f77caf0259731f1d3419b5b10f8542e5e86d6539 Mon Sep 17 00:00:00 2001 From: George <35490284+noctrex@users.noreply.github.com> Date: Sat, 2 May 2026 02:20:54 +0300 Subject: [PATCH] fix(store.c): improve root path integrity check with range-based validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the fragile NOT IN list of individual characters with a range-based BETWEEN 'A' AND 'Z' check for validating project root paths. The previous query only excluded letters A–H, leaving paths starting with I–Z silently invalid. In Windows, all the alphabet can be used. A Windows drive starting with letters I-Z breaks the saving of the database. --- src/store/store.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/store.c b/src/store/store.c index 5d73dcce..b0f513e9 100644 --- a/src/store/store.c +++ b/src/store/store.c @@ -639,7 +639,8 @@ bool cbm_store_check_integrity(cbm_store_t *s) { rc = sqlite3_prepare_v2( s->db, "SELECT root_path FROM projects WHERE root_path != '' " - "AND substr(root_path, 1, 1) NOT IN ('/', 'A','B','C','D','E','F','G','H') LIMIT 1;", + "AND NOT (substr(root_path, 1, 1) = '/' " + "OR (substr(root_path, 1, 1) BETWEEN 'A' AND 'Z')) LIMIT 1;", CBM_NOT_FOUND, &stmt, NULL); if (rc == SQLITE_OK) { if (sqlite3_step(stmt) == SQLITE_ROW) {