diff options
author | lookshe <github@lookshe.org> | 2016-02-09 22:03:33 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-02-09 22:03:33 +0100 |
commit | 335423fb9ded67f3820f34793a7774d9f35d7c09 (patch) | |
tree | 17792237c9678c2b5b93615eab97378364079376 | |
parent | 5aa2eb80475c4821eed89ae0b6a4585e3be3af60 (diff) |
normal path in titleflatten_tree
-rw-r--r-- | ui-tree.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -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; |