{
if (lseek(fd, skip, SEEK_CUR) == (off_t)-1) {
if ((errno != ESPIPE) || (bb_copyfd_size(fd, -1, skip) != skip)) {
- bb_error_msg_and_die("Seek failure");
+ bb_error_msg_and_die("seek failure");
}
}
}
/* Create all leading directories */
char *name = xstrdup(fn);
if (bb_make_directory(dirname(name), 0777, FILEUTILS_RECUR)) {
- bb_error_msg_and_die("Exiting"); /* bb_make_directory is noisy */
+ bb_error_msg_and_die("exiting"); /* bb_make_directory is noisy */
}
free(name);
}
{
if (zip_header->formatted.method == 0) {
/* Method 0 - stored (not compressed) */
- int size = zip_header->formatted.ucmpsize;
+ off_t size = zip_header->formatted.ucmpsize;
if (size && (bb_copyfd_size(src_fd, dst_fd, size) != size)) {
- bb_error_msg_and_die("Cannot complete extraction");
+ bb_error_msg_and_die("cannot complete extraction");
}
} else {
inflate_cleanup();
/* Validate decompression - crc */
if (zip_header->formatted.crc32 != (gunzip_crc ^ 0xffffffffL)) {
- bb_error_msg("Invalid compressed data--crc error");
+ bb_error_msg("invalid compressed data--%s error", "crc");
return 1;
}
/* Validate decompression - size */
if (zip_header->formatted.ucmpsize != gunzip_bytes_out) {
- bb_error_msg("Invalid compressed data--length error");
+ bb_error_msg("invalid compressed data--%s error", "length");
return 1;
}
}
}
if (src_fd == -1) {
src_fn[orig_src_fn_len] = 0;
- bb_error_msg_and_die("Cannot open %s, %s.zip, %s.ZIP", src_fn, src_fn, src_fn);
+ bb_error_msg_and_die("cannot open %s, %s.zip, %s.ZIP", src_fn, src_fn, src_fn);
}
}
if (magic == ZIP_CDS_MAGIC) {
break;
} else if (magic != ZIP_FILEHEADER_MAGIC) {
- bb_error_msg_and_die("Invalid zip magic %08X", magic);
+ bb_error_msg_and_die("invalid zip magic %08X", magic);
}
/* Read the file header */
zip_header.formatted.filename_len = SWAP_LE32(zip_header.formatted.filename_len);
zip_header.formatted.extra_len = SWAP_LE32(zip_header.formatted.extra_len);
if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
- bb_error_msg_and_die("Unsupported compression method %d", zip_header.formatted.method);
+ bb_error_msg_and_die("unsupported compression method %d", zip_header.formatted.method);
}
/* Read filename */
if ((verbosity == v_list) && !list_header_done){
printf(" Length Date Time Name\n"
- " -------- ---- ---- ----\n");
+ " -------- ---- ---- ----\n");
list_header_done = 1;
}
} else if (last_char_is(dst_fn, '/')) { /* Extract directory */
if (stat(dst_fn, &stat_buf) == -1) {
if (errno != ENOENT) {
- bb_perror_msg_and_die("Cannot stat '%s'",dst_fn);
+ bb_perror_msg_and_die("cannot stat '%s'",dst_fn);
}
if (verbosity == v_normal) {
printf(" creating: %s\n", dst_fn);
}
unzip_create_leading_dirs(dst_fn);
if (bb_make_directory(dst_fn, 0777, 0)) {
- bb_error_msg_and_die("Exiting");
+ bb_error_msg_and_die("exiting");
}
} else {
if (!S_ISDIR(stat_buf.st_mode)) {
_check_file:
if (stat(dst_fn, &stat_buf) == -1) { /* File does not exist */
if (errno != ENOENT) {
- bb_perror_msg_and_die("Cannot stat '%s'",dst_fn);
+ bb_perror_msg_and_die("cannot stat '%s'",dst_fn);
}
i = 'y';
} else {
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
if (!fgets(key_buf, 512, stdin)) {
- bb_perror_msg_and_die("Cannot read input");
+ bb_perror_msg_and_die("cannot read input");
}
i = key_buf[0];
}
/* Prompt for new name */
printf("new name: ");
if (!fgets(key_buf, 512, stdin)) {
- bb_perror_msg_and_die("Cannot read input");
+ bb_perror_msg_and_die("cannot read input");
}
free(dst_fn);
dst_fn = xstrdup(key_buf);