summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-03-26 12:07:04 +0000
committerJim Meyering <jim@meyering.net>2006-03-26 12:07:04 +0000
commit02b8c9a4525c30d25a0f98f5a6686416f23d5452 (patch)
tree81be2efe6dc8726816194b450369e01ac38433f9 /src/ln.c
parent9c3afb4a64da15ccbd24ad76bb29469428eb37d2 (diff)
downloadcoreutils-02b8c9a4525c30d25a0f98f5a6686416f23d5452.tar.xz
(target_directory_operand, main): Use new last_component, in place of base_name.
Diffstat (limited to 'src/ln.c')
-rw-r--r--src/ln.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ln.c b/src/ln.c
index 49a385c3d..49163fde6 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -1,5 +1,5 @@
/* `ln' program to create links between files.
- Copyright (C) 86, 89, 90, 91, 1995-2005 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1989-1991, 1995-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -113,7 +113,7 @@ static struct option const long_options[] =
static bool
target_directory_operand (char const *file)
{
- char const *b = base_name (file);
+ char const *b = last_component (file);
size_t blen = strlen (b);
bool looks_like_a_dir = (blen == 0 || ISSLASH (b[blen - 1]));
struct stat st;
@@ -525,7 +525,8 @@ main (int argc, char **argv)
for (i = 0; i < n_files; ++i)
{
char *dest_base;
- char *dest = file_name_concat (target_directory, base_name (file[i]),
+ char *dest = file_name_concat (target_directory,
+ last_component (file[i]),
&dest_base);
strip_trailing_slashes (dest_base);
ok &= do_link (file[i], dest);