summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-12-19 04:30:32 +0000
committerJim Meyering <jim@meyering.net>1995-12-19 04:30:32 +0000
commite49897affc7bb2448b19be60819f35762186f73a (patch)
tree76225270f44b31b3b915baca532740709bf69e55 /src
parent2ef6cb60734488c3200b12fd1089fa4dd66eac58 (diff)
downloadcoreutils-e49897affc7bb2448b19be60819f35762186f73a.tar.xz
[SYMBOLIC_SPACE_STRING]: New macro.
(do_link): Use it instead of open-coded #ifdef. For --verbose, say `create link DEST to SRC' instead of ambiguous (or inconsistent with cp -v and mv -v) `SRC -> DEST.'
Diffstat (limited to 'src')
-rw-r--r--src/ln.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ln.c b/src/ln.c
index b23914c84..6adf6cf4f 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -37,6 +37,12 @@ int link (); /* Some systems don't declare this anywhere. */
int symlink ();
#endif
+#ifdef S_ISLNK
+# define SYMBOLIC_SPACE_STRING symbolic_link ? _("symbolic ") : ""
+#else
+# define SYMBOLIC_SPACE_STRING ""
+#endif
+
/* Construct a string NEW_DEST by concatenating DEST, a slash, and
basename(SOURCE) in alloca'd memory. Don't modify DEST or SOURCE. */
@@ -233,19 +239,15 @@ do_link (char *source, char *dest)
}
if (verbose)
- printf ("%s -> %s\n", source, dest);
+ printf (_("create %slink %s to %s\n"), SYMBOLIC_SPACE_STRING,
+ dest, source);
if ((*linkfunc) (source, dest) == 0)
{
return 0;
}
- error (0, errno, _("cannot %slink `%s' to `%s'"),
-#ifdef S_ISLNK
- symbolic_link ? _("symbolic ") : "",
-#else
- "",
-#endif
+ error (0, errno, _("cannot %slink `%s' to `%s'"), SYMBOLIC_SPACE_STRING,
source, dest);
if (dest_backup)