summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-02-27 15:01:21 +0000
committerJim Meyering <jim@meyering.net>2000-02-27 15:01:21 +0000
commitdda6c3fdc48c056bb9ede127a54dfb69ffb53b99 (patch)
tree986a634d4394d04961e13f289ea52295a75a2424 /src
parent9d343b0852aadd62064fc949dd843e21d28351b4 (diff)
downloadcoreutils-dda6c3fdc48c056bb9ede127a54dfb69ffb53b99.tar.xz
(install_file_to_path): Always use install_file_in_file.
Based on a patch from Adam Klein via Michael Stone.
Diffstat (limited to 'src')
-rw-r--r--src/install.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/install.c b/src/install.c
index 37a57ace7..18a6fd71c 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1,5 +1,5 @@
/* install - copy files and set attributes
- Copyright (C) 89, 90, 91, 1995-1999 Free Software Foundation, Inc.
+ Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -393,7 +393,7 @@ install_file_to_path (const char *from, const char *to,
const struct cp_options *x)
{
char *dest_dir;
- int fail;
+ int fail = 0;
dest_dir = dir_name (to);
@@ -408,15 +408,11 @@ install_file_to_path (const char *from, const char *to,
#define DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
fail = make_path (dest_dir, DIR_MODE, DIR_MODE, owner_id, group_id, 0,
(x->verbose ? _("creating directory `%s'") : NULL));
-
- if (fail == 0)
- fail = install_file_in_dir (from, dest_dir, x);
- }
- else
- {
- fail = install_file_in_file (from, to, x);
}
+ if (fail == 0)
+ fail = install_file_in_file (from, to, x);
+
free (dest_dir);
return fail;