diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 27 |
1 files changed, 2 insertions, 25 deletions
| @@ -912,32 +912,9 @@ int history_del(snac *snac, char *id) | |||
| 912 | 912 | ||
| 913 | d_char *history_list(snac *snac) | 913 | d_char *history_list(snac *snac) |
| 914 | { | 914 | { |
| 915 | d_char *list; | 915 | xs *spec = xs_fmt("%s/history/" "*.html", snac->basedir); |
| 916 | xs *spec; | ||
| 917 | glob_t globbuf; | ||
| 918 | |||
| 919 | list = xs_list_new(); | ||
| 920 | spec = xs_fmt("%s/history/" "*.html", snac->basedir); | ||
| 921 | |||
| 922 | if (glob(spec, 0, NULL, &globbuf) == 0) { | ||
| 923 | int n; | ||
| 924 | char *fn; | ||
| 925 | |||
| 926 | for (n = 0; (fn = globbuf.gl_pathv[n]) != NULL; n++) { | ||
| 927 | char *p; | ||
| 928 | |||
| 929 | if ((p = strrchr(fn, '/')) != NULL) { | ||
| 930 | *p++ = '\0'; | ||
| 931 | 916 | ||
| 932 | if (*p != '_') | 917 | return xs_glob(spec, 1, 0); |
| 933 | list = xs_list_append(list, p); | ||
| 934 | } | ||
| 935 | } | ||
| 936 | } | ||
| 937 | |||
| 938 | globfree(&globbuf); | ||
| 939 | |||
| 940 | return list; | ||
| 941 | } | 918 | } |
| 942 | 919 | ||
| 943 | 920 | ||