summaryrefslogtreecommitdiffhomepage
path: root/coreutils/basename.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/basename.c')
-rw-r--r--coreutils/basename.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c
index f59d7a8de..ec1f85bef 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -34,7 +34,8 @@ int basename_main(int argc, char **argv)
bb_show_usage();
}
- s = bb_get_last_path_component(*++argv);
+ /* It should strip slash: /abc/def/ -> def */
+ s = bb_get_last_path_component_strip(*++argv);
if (*++argv) {
n = strlen(*argv);