diff options
| -rw-r--r-- | page.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -333,7 +333,7 @@ end: } static int add_element(struct html_node *const n, const char *const dir, - const char *const res, const char *const name) + const char *const res, const char *const name, const bool chbx) { int ret = -1; enum {RM_CHECKBOX, NAME, SIZE, DATE, SHARE, PREVIEW, COLUMNS}; @@ -370,7 +370,7 @@ static int add_element(struct html_node *const n, const char *const dir, __func__, path.str, strerror(errno)); goto end; } - else if (strcmp(name, "..") + else if (chbx && strcmp(name, "..") && prepare_rm_checkbox(td[RM_CHECKBOX], &sb, name)) { fprintf(stderr, "%s: prepare_rm_checkbox failed\n", __func__); @@ -1138,7 +1138,7 @@ static int add_elements(const char *const root, const char *const res, if (!strcmp(name, ".") || (!strcmp(name, "..") && !strcmp(root, res))) continue; - else if (add_element(table, dir, res, name)) + else if (add_element(table, dir, res, name, true)) { fprintf(stderr, "%s: add_element failed\n", __func__); goto end; @@ -1784,7 +1784,7 @@ static int add_search_results(struct html_node *const n, { const struct page_search_result *const r = &s->results[i]; - if (add_element(table, "/user/", s->root, r->name)) + if (add_element(table, "/user/", s->root, r->name, false)) { fprintf(stderr, "%s: add_element failed\n", __func__); return -1; |
