diff options
author | Jim Meyering <jim@meyering.net> | 1998-01-22 08:12:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-01-22 08:12:24 +0000 |
commit | 2bdf8621d629a8e1ff5f736222a4ad2251aa1837 (patch) | |
tree | 4e62c07cdfe21aab2436be5b1ee956707474e64d /src | |
parent | 758ab7a01392c21de95ca1f8f33465e231457a2d (diff) | |
download | coreutils-2bdf8621d629a8e1ff5f736222a4ad2251aa1837.tar.xz |
Declare new global, backup_type.
(main): Initialize backup_type unconditionally.
(copy_file): Call find_backup_file_name with new backup_type, argument.
Diffstat (limited to 'src')
-rw-r--r-- | src/install.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/install.c b/src/install.c index 878d9cd60..4b2fec673 100644 --- a/src/install.c +++ b/src/install.c @@ -138,6 +138,9 @@ static void usage PARAMS ((int status)); /* The name this program was run with, for error messages. */ char *program_name; +/* FIXME: document */ +enum backup_type backup_type; + /* The user name that will own the files, or NULL to make the owner the current user ID. */ static char *owner_name; @@ -281,8 +284,7 @@ main (int argc, char **argv) error (1, 0, _("the strip option may not be used when installing a directory")); - if (make_backups) - backup_type = get_version (version); + backup_type = (make_backups ? get_version (version) : none); if (optind == argc || (optind == argc - 1 && !dir_arg)) { @@ -465,7 +467,7 @@ copy_file (const char *from, const char *to, int *to_created) /* The destination file exists. Try to back it up if required. */ if (backup_type != none) { - char *tmp_backup = find_backup_file_name (to); + char *tmp_backup = find_backup_file_name (to, backup_type); char *dst_backup; if (tmp_backup == NULL) |