From 05c44474d19428b23309360a42b543ab272a2bac Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 7 Oct 2015 20:10:40 +0200 Subject: [PATCH] Simplify code a bit --- zathura/zathura.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index bf6dcec..b44d8a5 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -576,13 +576,7 @@ get_formatted_filename(zathura_t* zathura, const char* file_path, bool statusbar && g_str_has_prefix(file_path, home) && (!file_path[home_len] || file_path[home_len] == '/')) { - size_t remaining_len = file_path_len - home_len; - - GString* remaining_path = g_string_new_len(&file_path[home_len], remaining_len); - char* tilde_path = g_strdup_printf("~%s", remaining_path->str); - g_string_free(remaining_path, true); - - return tilde_path; + return g_strdup_printf("~%s", &file_path[home_len]); } else { return g_strdup(file_path); }