commit 7466241

default  ·  2022-12-14 04:36:30 +0000 UTC
parent 645e7ec
Fixed a deletion error.
1 files changed,  +9, -1
M data.c
M data.c
+9, -1
 1@@ -241,7 +241,7 @@ int index_add(const char *fn, const char *id)
 2 }
 3 
 4 
 5-int index_del(const char *fn, const char *md5)
 6+int index_del_md5(const char *fn, const char *md5)
 7 /* deletes an md5 from an index */
 8 {
 9     int status = 404;
10@@ -279,6 +279,14 @@ int index_del(const char *fn, const char *md5)
11 }
12 
13 
14+int index_del(const char *fn, const char *id)
15+/* deletes an id from an index */
16+{
17+    xs *md5 = xs_md5_hex(id, strlen(id));
18+    return index_del_md5(fn, md5);
19+}
20+
21+
22 int index_in_md5(const char *fn, const char *md5)
23 /* checks if the md5 is already in the index */
24 {