From d3612f3c9b17a701f1deae29407f5821d681ae3e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 29 Apr 2016 18:57:35 +0200 Subject: [PATCH] Remove useless g_strdup Signed-off-by: Sebastian Ramacher --- zathura/completion.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zathura/completion.c b/zathura/completion.c index 5e269f6..92a25c7 100644 --- a/zathura/completion.c +++ b/zathura/completion.c @@ -175,12 +175,10 @@ list_files_for_cc(zathura_t* zathura, const char* input, bool check_file_ext, in } /* get current path */ - char* tmp = g_strdup(path); - current_path = is_dir ? g_strdup(tmp) : g_strdup(dirname(tmp)); - g_free(tmp); + current_path = is_dir ? g_strdup(path) : g_path_get_dirname(path); /* get current file */ - gchar* current_file = is_dir ? "" : basename(path); + gchar* current_file = is_dir ? "" : basename(path); const size_t current_file_length = strlen(current_file); /* read directory */