snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 3355d5559dc03f01382282409f33ca6908e495fe
parent 82ec4ea95cb1040c5b9b983ec649dbde024d20f8
Author: default <nobody@localhost>
Date:   Tue,  7 May 2024 20:51:24 +0200

New op #3 to list_maint() (get list name).

Diffstat:
Mdata.c | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/data.c b/data.c @@ -1830,6 +1830,19 @@ xs_val *list_maint(snac *user, const char *list, int op) } break; + + case 3: /** get list name **/ + if (xs_is_hex(list)) { + FILE *f; + xs *fn = xs_fmt("%s/list/%s.id", user->basedir, list); + + if ((f = fopen(fn, "r")) != NULL) { + l = xs_strip_i(xs_readline(f)); + fclose(f); + } + } + + break; } return l;