aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-02-09 22:03:33 +0100
committerlookshe <github@lookshe.org>2016-02-09 22:03:33 +0100
commit335423fb9ded67f3820f34793a7774d9f35d7c09 (patch)
tree17792237c9678c2b5b93615eab97378364079376
parent5aa2eb80475c4821eed89ae0b6a4585e3be3af60 (diff)
normal path in titleflatten_tree
-rw-r--r--ui-tree.c17
1 files 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;