diff options
author | Rishabh Dave <rishabhddave@gmail.com> | 2016-11-02 23:43:47 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-11-07 17:09:35 +0000 |
commit | ec946718ae7c329ba4d4ef46a467bba125c141a6 (patch) | |
tree | 5c7042af93646e96d5ccdd5cdde6a62b51800124 /src/ln.c | |
parent | 30012b290facf66551cdf395ace397903d00483d (diff) | |
download | coreutils-ec946718ae7c329ba4d4ef46a467bba125c141a6.tar.xz |
maint: simplify handling of backup --suffix in various tools
* src/cp.c (main): Avoid the getenv("SIMPLE_BACKUP_SUFFIX") call,
which is now done if needed in the gnulib backupfile module.
Also avoid the redundant strdup, as we don't modify this suffix.
* src/install.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/mv.c (main): Likewise.
Fixes http://bugs.gnu.org/23153
Diffstat (limited to 'src/ln.c')
-rw-r--r-- | src/ln.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -465,7 +465,6 @@ main (int argc, char **argv) int c; bool ok; bool make_backups = false; - char *backup_suffix_string; char *version_control_string = NULL; char const *target_directory = NULL; bool no_target_directory = false; @@ -480,10 +479,6 @@ main (int argc, char **argv) atexit (close_stdin); - /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless - we'll actually use backup_suffix_string. */ - backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - symbolic_link = remove_existing_files = interactive = verbose = hard_dir_link = false; @@ -547,7 +542,7 @@ main (int argc, char **argv) break; case 'S': make_backups = true; - backup_suffix_string = optarg; + simple_backup_suffix = optarg; break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -594,9 +589,6 @@ main (int argc, char **argv) quoteaf (file[n_files - 1])); } - if (backup_suffix_string) - simple_backup_suffix = xstrdup (backup_suffix_string); - backup_type = (make_backups ? xget_version (_("backup type"), version_control_string) : no_backups); |