summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-01-22 08:13:12 +0000
committerJim Meyering <jim@meyering.net>1998-01-22 08:13:12 +0000
commit1a18272561fbd7456e6914155246e5d02e48bd57 (patch)
tree60f2a3fec657cfa230830c8c5700bff4e78d052e /src
parent2bdf8621d629a8e1ff5f736222a4ad2251aa1837 (diff)
downloadcoreutils-1a18272561fbd7456e6914155246e5d02e48bd57.tar.xz
Declare new global, backup_type.
(main): Initialize backup_type unconditionally. (do_link): Call find_backup_file_name with new argument, backup_type.
Diffstat (limited to 'src')
-rw-r--r--src/ln.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ln.c b/src/ln.c
index 70cb328ca..a9e9b965a 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -67,6 +67,9 @@ void strip_trailing_slashes ();
/* The name by which the program was run, for error messages. */
char *program_name;
+/* FIXME: document */
+enum backup_type backup_type;
+
/* A pointer to the function used to make links. This will point to either
`link' or `symlink'. */
static int (*linkfunc) ();
@@ -266,7 +269,7 @@ do_link (const char *source, const char *dest)
if (backup_type != none)
{
- char *tmp_backup = find_backup_file_name (dest);
+ char *tmp_backup = find_backup_file_name (dest, backup_type);
if (tmp_backup == NULL)
error (1, 0, _("virtual memory exhausted"));
dest_backup = (char *) alloca (strlen (tmp_backup) + 1);
@@ -444,8 +447,7 @@ main (int argc, char **argv)
usage (1);
}
- if (make_backups)
- backup_type = get_version (version);
+ backup_type = (make_backups ? get_version (version) : none);
#ifdef S_ISLNK
if (symbolic_link)