[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.'
This commit is contained in:
Jim Meyering
1995-12-19 04:30:32 +00:00
parent 2ef6cb6073
commit e49897affc
+9 -7
View File
@@ -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)