aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;