is_gunzipable() -> get_compression_type()

This commit is contained in:
Pavel Roskin 2002-07-02 21:12:10 +00:00
parent 3860ff7b34
commit 7f6c3c3bb6
2 changed files with 4 additions and 6 deletions

View File

@ -135,7 +135,7 @@ static void cpio_free_archive(vfs *me, vfs_s_super *super)
static int cpio_open_cpio_file(vfs *me, vfs_s_super *super, char *name)
{
int fd, size, type;
int fd, type;
mode_t mode;
vfs_s_inode *root;
@ -149,8 +149,7 @@ static int cpio_open_cpio_file(vfs *me, vfs_s_super *super, char *name)
mc_stat(name, &(super->u.cpio.stat));
super->u.cpio.type = CPIO_UNKNOWN;
size = is_gunzipable(fd, &type);
if(size > 0) {
if (get_compression_type(fd) != COMPRESSION_NONE) {
char *s;
mc_close(fd);

View File

@ -72,7 +72,6 @@ static int current_tar_position = 0;
static int tar_open_archive (vfs *me, char *name, vfs_s_super *archive)
{
int result, type;
long size;
mode_t mode;
struct vfs_s_inode *root;
@ -87,9 +86,9 @@ static int tar_open_archive (vfs *me, char *name, vfs_s_super *archive)
archive->u.tar.fd = -1;
/* Find out the method to handle this tar file */
size = is_gunzipable (result, &type);
type = get_compression_type (result);
mc_lseek (result, 0, SEEK_SET);
if (size > 0) {
if (type != COMPRESSION_NONE) {
char *s;
mc_close( result );
s = g_strconcat ( archive->name, decompress_extension (type), NULL );