summaryrefslogtreecommitdiff
path: root/src/delta
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-06 21:29:55 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-06 21:29:55 -0500
commit2b6bf07dd23bb467099d213c97b3875c5e453491 (patch)
tree2127e24f28714b48f6c00e92eaec351bcb57e5d5 /src/delta
parentf4336098941f94d23f2f6c79bc8d055a0907c392 (diff)
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.
Diffstat (limited to 'src/delta')
-rw-r--r--src/delta/delta.c8
1 files changed, 4 insertions, 4 deletions
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;