Forráskód Böngészése

Use xs_glob() in history_list().

default 3 éve
szülő
commit
7414b000ee
1 módosított fájl, 2 hozzáadás és 25 törlés
  1. 2 25
      data.c

+ 2 - 25
data.c

@@ -912,32 +912,9 @@ int history_del(snac *snac, char *id)
 
 d_char *history_list(snac *snac)
 {
-    d_char *list;
-    xs *spec;
-    glob_t globbuf;
-
-    list = xs_list_new();
-    spec = xs_fmt("%s/history/" "*.html", snac->basedir);
-
-    if (glob(spec, 0, NULL, &globbuf) == 0) {
-        int n;
-        char *fn;
-
-        for (n = 0; (fn = globbuf.gl_pathv[n]) != NULL; n++) {
-            char *p;
-
-            if ((p = strrchr(fn, '/')) != NULL) {
-                *p++ = '\0';
+    xs *spec = xs_fmt("%s/history/" "*.html", snac->basedir);
 
-                if (*p != '_')
-                    list = xs_list_append(list, p);
-            }
-        }
-    }
-
-    globfree(&globbuf);
-
-    return list;
+    return xs_glob(spec, 1, 0);
 }