aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/ar.c3
-rw-r--r--archival/bunzip2.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/archival/ar.c b/archival/ar.c
index 09d0cd7e4..e10bf7c47 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -26,7 +26,8 @@ static void header_verbose_list_ar(const file_header_t *file_header)
26 mtime[16] = ' '; 26 mtime[16] = ' ';
27 memmove(&mtime[17], &mtime[20], 4); 27 memmove(&mtime[17], &mtime[20], 4);
28 mtime[21] = '\0'; 28 mtime[21] = '\0';
29 printf("%s %d/%d%7d %s %s\n", &mode[1], file_header->uid, file_header->gid, (int) file_header->size, &mtime[4], file_header->name); 29 printf("%s %d/%d%7d %s %s\n", &mode[1], file_header->uid, file_header->gid,
30 (int) file_header->size, &mtime[4], file_header->name);
30} 31}
31 32
32#define AR_CTX_PRINT 0x01 33#define AR_CTX_PRINT 0x01
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index 9810e0290..62f28582c 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -36,7 +36,8 @@ int bunzip2_main(int argc, char **argv)
36 36
37 /* Check that the input is sane. */ 37 /* Check that the input is sane. */
38 if (isatty(src_fd) && (opt & BUNZIP2_OPT_FORCE) == 0) { 38 if (isatty(src_fd) && (opt & BUNZIP2_OPT_FORCE) == 0) {
39 bb_error_msg_and_die("Compressed data not read from terminal. Use -f to force it."); 39 bb_error_msg_and_die("Compressed data not read from terminal. "
40 "Use -f to force it.");
40 } 41 }
41 42
42 if (filename) { 43 if (filename) {
@@ -45,7 +46,7 @@ int bunzip2_main(int argc, char **argv)
45 * strlen may be less than 4 */ 46 * strlen may be less than 4 */
46 char *extension = strrchr(filename, '.'); 47 char *extension = strrchr(filename, '.');
47 if (!extension || strcmp(extension, ".bz2") != 0) { 48 if (!extension || strcmp(extension, ".bz2") != 0) {
48 bb_error_msg_and_die("Invalid extension"); 49 bb_error_msg_and_die("invalid extension");
49 } 50 }
50 xstat(filename, &stat_buf); 51 xstat(filename, &stat_buf);
51 *extension = '\0'; 52 *extension = '\0';
@@ -53,10 +54,10 @@ int bunzip2_main(int argc, char **argv)
53 stat_buf.st_mode); 54 stat_buf.st_mode);
54 } else dst_fd = STDOUT_FILENO; 55 } else dst_fd = STDOUT_FILENO;
55 status = uncompressStream(src_fd, dst_fd); 56 status = uncompressStream(src_fd, dst_fd);
56 if(filename) { 57 if (filename) {
57 if (!status) filename[strlen(filename)] = '.'; 58 if (!status) filename[strlen(filename)] = '.';
58 if (unlink(filename) < 0) { 59 if (unlink(filename) < 0) {
59 bb_error_msg_and_die("Couldn't remove %s", filename); 60 bb_error_msg_and_die("cannot remove %s", filename);
60 } 61 }
61 } 62 }
62 63