diff options
author | Jim Meyering <jim@meyering.net> | 1995-12-19 04:30:32 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1995-12-19 04:30:32 +0000 |
commit | e49897affc7bb2448b19be60819f35762186f73a (patch) | |
tree | 76225270f44b31b3b915baca532740709bf69e55 | |
parent | 2ef6cb60734488c3200b12fd1089fa4dd66eac58 (diff) | |
download | coreutils-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.'
-rw-r--r-- | src/ln.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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) |