X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=archival%2Funcompress.c;h=4611790168dc9de568f5361b2d26928f9f7dcb84;hb=bbe514683a43e81cab1d5ccc0436b9aaf984294b;hp=8c466ebdf9d7df3597ef932c2ac82fa0638bb9e8;hpb=22dca23d52c836e40c79cb4042b867fdc06f6ca3;p=oweals%2Fbusybox.git diff --git a/archival/uncompress.c b/archival/uncompress.c index 8c466ebdf..461179016 100644 --- a/archival/uncompress.c +++ b/archival/uncompress.c @@ -16,16 +16,16 @@ int uncompress_main(int argc, char **argv) int status = EXIT_SUCCESS; unsigned long flags; - flags = bb_getopt_ulflags(argc, argv, "cf"); + flags = getopt32(argc, argv, "cf"); while (optind < argc) { - const char *compressed_file = argv[optind++]; - const char *delete_path = NULL; + char *compressed_file = argv[optind++]; + char *delete_path = NULL; char *uncompressed_file = NULL; int src_fd; int dst_fd; - if (strcmp(compressed_file, "-") == 0) { + if (LONE_DASH(compressed_file)) { src_fd = STDIN_FILENO; flags |= GUNZIP_TO_STDOUT; } else { @@ -49,7 +49,7 @@ int uncompress_main(int argc, char **argv) extension = strrchr(uncompressed_file, '.'); if (!extension || (strcmp(extension, ".Z") != 0)) { - bb_error_msg_and_die("Invalid extension"); + bb_error_msg_and_die("invalid extension"); } *extension = '\0'; @@ -65,7 +65,7 @@ int uncompress_main(int argc, char **argv) /* do the decompression, and cleanup */ if ((xread_char(src_fd) != 0x1f) || (xread_char(src_fd) != 0x9d)) { - bb_error_msg_and_die("Invalid magic"); + bb_error_msg_and_die("invalid magic"); } status = uncompress(src_fd, dst_fd); @@ -84,7 +84,7 @@ int uncompress_main(int argc, char **argv) /* delete_path will be NULL if in test mode or from stdin */ if (delete_path && (unlink(delete_path) == -1)) { - bb_error_msg_and_die("Couldn't remove %s", delete_path); + bb_error_msg_and_die("cannot remove %s", delete_path); } free(uncompressed_file);