summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/directory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/render/directory.c b/render/directory.c
index 193941ecf..4cb9c8af4 100644
--- a/render/directory.c
+++ b/render/directory.c
@@ -100,11 +100,13 @@ bool directory_convert(struct content *c) {
(uint8_t *) buffer, strlen(buffer));
res = url_parent(content__get_url(c), &up);
+
if (res == URL_FUNC_OK) {
res = url_compare(content__get_url(c), up, false, &compare);
if ((res == URL_FUNC_OK) && !compare) {
+ if(up[strlen(up) - 1] == '/') up[strlen(up) - 1] = '\0';
snprintf(buffer, sizeof(buffer),
- "<a href=\"..\">[..]</a>\n");
+ "<a href=\"%s\">[..]</a>\n", up);
binding_parse_chunk(c->data.html.parser_binding,
(uint8_t *) buffer, strlen(buffer));