summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-08-04 19:00:46 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-08-04 19:00:46 +0300
commit47560a0498bde20621ce4e367b1d68bf8cd8f1a3 (patch)
treeeb962245eb9de39687832c9872ef5f54ae2b3f17 /src/buffer.c
parent6e5e4420f42cb9d90641cc01f228b07d9b3c4ef3 (diff)
downloadtar-47560a0498bde20621ce4e367b1d68bf8cd8f1a3.tar.gz
Fix interacton of --verbose and --append.
* src/buffer.c (_open_archive): don't overwrite existing archive if given the --verify option. * tests/append04.at: New file. * tests/Makefile.am: Add new testcase. * tests/testsuite.at: Add new testcase. * THANKS: Update.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 1452940b..97084ab5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -722,9 +722,6 @@ _open_archive (enum access_mode wanted_access)
break;
}
}
- else if (verify_option)
- archive = rmtopen (archive_name_array[0], O_RDWR | O_CREAT | O_BINARY,
- MODE_RW, rsh_command_option);
else
switch (wanted_access)
{
@@ -740,8 +737,12 @@ _open_archive (enum access_mode wanted_access)
maybe_backup_file (archive_name_array[0], 1);
backed_up_flag = 1;
}
- archive = rmtcreat (archive_name_array[0], MODE_RW,
- rsh_command_option);
+ if (verify_option)
+ archive = rmtopen (archive_name_array[0], O_RDWR | O_CREAT | O_BINARY,
+ MODE_RW, rsh_command_option);
+ else
+ archive = rmtcreat (archive_name_array[0], MODE_RW,
+ rsh_command_option);
break;
case ACCESS_UPDATE: