From 335423fb9ded67f3820f34793a7774d9f35d7c09 Mon Sep 17 00:00:00 2001 From: lookshe Date: Tue, 9 Feb 2016 22:03:33 +0100 Subject: normal path in title --- ui-tree.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/ui-tree.c b/ui-tree.c index eac1f2e..15e39e6 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -95,7 +95,7 @@ static void print_binary_buffer(char *buf, unsigned long size) static void set_title_from_path(const char *path) { - size_t path_len, path_index, path_last_end; + size_t path_len; char *new_title; if (!path) @@ -105,20 +105,7 @@ static void set_title_from_path(const char *path) new_title = xmalloc(path_len + 3 + strlen(ctx.page.title) + 1); new_title[0] = '\0'; - for (path_index = path_len, path_last_end = path_len; path_index-- > 0;) { - if (path[path_index] == '/') { - if (path_index == path_len - 1) { - path_last_end = path_index - 1; - continue; - } - strncat(new_title, &path[path_index + 1], path_last_end - path_index - 1); - strcat(new_title, "\\"); - path_last_end = path_index; - } - } - if (path_last_end) - strncat(new_title, path, path_last_end); - + strcat(new_title, path); strcat(new_title, " - "); strcat(new_title, ctx.page.title); ctx.page.title = new_title; -- cgit v1.2.3