From 2b6bf07dd23bb467099d213c97b3875c5e453491 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 6 Dec 2013 21:29:55 -0500 Subject: Get rid of our reimplementation of basename The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename. --- src/delta/delta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/delta/delta.c') diff --git a/src/delta/delta.c b/src/delta/delta.c index 4aaf1dfb14..0785e7b5e7 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -251,7 +251,7 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const if (!p) return -ENOMEM; - k = hashmap_put(h, path_get_file_name(p), p); + k = hashmap_put(h, basename(p), p); if (k < 0) { free(p); if (k != -EEXIST) @@ -303,7 +303,7 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch path_kill_slashes(p); - k = hashmap_put(top, path_get_file_name(p), p); + k = hashmap_put(top, basename(p), p); if (k >= 0) { p = strdup(p); if (!p) @@ -313,8 +313,8 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch return k; } - free(hashmap_remove(bottom, path_get_file_name(p))); - k = hashmap_put(bottom, path_get_file_name(p), p); + free(hashmap_remove(bottom, basename(p))); + k = hashmap_put(bottom, basename(p), p); if (k < 0) { free(p); return k; -- cgit v1.2.3-54-g00ecf