aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/bunzip2.c2
-rw-r--r--archival/gunzip.c2
-rw-r--r--archival/gzip.c2
-rw-r--r--archival/tar.c2
-rw-r--r--archival/uncompress.c2
-rw-r--r--archival/unlzma.c2
-rw-r--r--archival/unzip.c3
7 files changed, 7 insertions, 8 deletions
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index 757001fe4..a6cd17611 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -23,7 +23,7 @@ int bunzip2_main(int argc, char **argv)
23 23
24 /* Set input filename and number */ 24 /* Set input filename and number */
25 filename = argv[optind]; 25 filename = argv[optind];
26 if ((filename) && (filename[0] != '-') && (filename[1] != '\0')) { 26 if (filename && NOT_LONE_DASH(filename)) {
27 /* Open input file */ 27 /* Open input file */
28 src_fd = xopen(filename, O_RDONLY); 28 src_fd = xopen(filename, O_RDONLY);
29 } else { 29 } else {
diff --git a/archival/gunzip.c b/archival/gunzip.c
index e24401c71..c5deec3ce 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -58,7 +58,7 @@ int gunzip_main(int argc, char **argv)
58 58
59 optind++; 59 optind++;
60 60
61 if (old_path == NULL || strcmp(old_path, "-") == 0) { 61 if (old_path == NULL || LONE_DASH(old_path)) {
62 src_fd = STDIN_FILENO; 62 src_fd = STDIN_FILENO;
63 opt |= GUNZIP_OPT_STDOUT; 63 opt |= GUNZIP_OPT_STDOUT;
64 USE_DESKTOP(opt &= ~GUNZIP_OPT_VERBOSE;) 64 USE_DESKTOP(opt &= ~GUNZIP_OPT_VERBOSE;)
diff --git a/archival/gzip.c b/archival/gzip.c
index c9b67538e..7124e9bd4 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -1201,7 +1201,7 @@ int gzip_main(int argc, char **argv)
1201 char *path = NULL; 1201 char *path = NULL;
1202 1202
1203 clear_bufs(); 1203 clear_bufs();
1204 if (strcmp(argv[i], "-") == 0) { 1204 if (LONE_DASH(argv[i])) {
1205 time_stamp = 0; 1205 time_stamp = 0;
1206 inFileNum = STDIN_FILENO; 1206 inFileNum = STDIN_FILENO;
1207 outFileNum = STDOUT_FILENO; 1207 outFileNum = STDOUT_FILENO;
diff --git a/archival/tar.c b/archival/tar.c
index 79c3595ac..ba7cb0f8c 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -851,7 +851,7 @@ int tar_main(int argc, char **argv)
851 flags = O_RDONLY; 851 flags = O_RDONLY;
852 } 852 }
853 853
854 if (tar_filename[0] == '-' && !tar_filename[1]) { 854 if (LONE_DASH(tar_filename)) {
855 tar_handle->src_fd = fileno(tar_stream); 855 tar_handle->src_fd = fileno(tar_stream);
856 tar_handle->seek = seek_by_read; 856 tar_handle->seek = seek_by_read;
857 } else { 857 } else {
diff --git a/archival/uncompress.c b/archival/uncompress.c
index 3c78961d5..461179016 100644
--- a/archival/uncompress.c
+++ b/archival/uncompress.c
@@ -25,7 +25,7 @@ int uncompress_main(int argc, char **argv)
25 int src_fd; 25 int src_fd;
26 int dst_fd; 26 int dst_fd;
27 27
28 if (strcmp(compressed_file, "-") == 0) { 28 if (LONE_DASH(compressed_file)) {
29 src_fd = STDIN_FILENO; 29 src_fd = STDIN_FILENO;
30 flags |= GUNZIP_TO_STDOUT; 30 flags |= GUNZIP_TO_STDOUT;
31 } else { 31 } else {
diff --git a/archival/unlzma.c b/archival/unlzma.c
index 46fbefdc0..20c4ff2a7 100644
--- a/archival/unlzma.c
+++ b/archival/unlzma.c
@@ -26,7 +26,7 @@ int unlzma_main(int argc, char **argv)
26 26
27 /* Set input filename and number */ 27 /* Set input filename and number */
28 filename = argv[optind]; 28 filename = argv[optind];
29 if (filename && (filename[0] != '-') && (filename[1] != '\0')) { 29 if (filename && NOT_LONE_DASH(filename)) {
30 /* Open input file */ 30 /* Open input file */
31 src_fd = xopen(filename, O_RDONLY); 31 src_fd = xopen(filename, O_RDONLY);
32 } else { 32 } else {
diff --git a/archival/unzip.c b/archival/unzip.c
index 8b1c281c4..f553eefa2 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -187,11 +187,10 @@ int unzip_main(int argc, char **argv)
187 } 187 }
188 188
189 /* Open input file */ 189 /* Open input file */
190 if (strcmp("-", src_fn) == 0) { 190 if (LONE_DASH(src_fn)) {
191 src_fd = STDIN_FILENO; 191 src_fd = STDIN_FILENO;
192 /* Cannot use prompt mode since zip data is arriving on STDIN */ 192 /* Cannot use prompt mode since zip data is arriving on STDIN */
193 overwrite = (overwrite == o_prompt) ? o_never : overwrite; 193 overwrite = (overwrite == o_prompt) ? o_never : overwrite;
194
195 } else { 194 } else {
196 static const char *const extn[] = {"", ".zip", ".ZIP"}; 195 static const char *const extn[] = {"", ".zip", ".ZIP"};
197 int orig_src_fn_len = strlen(src_fn); 196 int orig_src_fn_len = strlen(src_fn);