Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 219412 | Differences between
and this patch

Collapse All | Expand All

(-)mc-4.6.2-pre1.orig/edit/edit.c (+1 lines)
Lines 181-186 Link Here
181
static const struct edit_filters {
181
static const struct edit_filters {
182
    const char *read, *write, *extension;
182
    const char *read, *write, *extension;
183
} all_filters[] = {
183
} all_filters[] = {
184
    { "lzma -cd %s 2>&1",   "lzma > %s",   ".lzma" },
184
    { "bzip2 -cd %s 2>&1",  "bzip2 > %s",  ".bz2" },
185
    { "bzip2 -cd %s 2>&1",  "bzip2 > %s",  ".bz2" },
185
    { "gzip -cd %s 2>&1",   "gzip > %s",   ".gz"  },
186
    { "gzip -cd %s 2>&1",   "gzip > %s",   ".gz"  },
186
    { "gzip -cd %s 2>&1",   "gzip > %s",   ".Z"   }
187
    { "gzip -cd %s 2>&1",   "gzip > %s",   ".Z"   }
(-)mc-4.6.2-pre1.orig/lib/mc.ext.in (-1 / +15 lines)
Lines 115-124 Link Here
115
	# Open=%cd %p#utar
115
	# Open=%cd %p#utar
116
	View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
116
	View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
117
117
118
regex/\.t(ar\.bz2|bz|b2)$
118
regex/\.t(ar\.bz2|bz2?|b2)$
119
	Open=%cd %p#utar
119
	Open=%cd %p#utar
120
	View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
120
	View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
121
121
122
# .tar.lzma, .tlz
123
regex/\.t(ar\.lzma|lz)$
124
	Open=%cd %p#utar
125
	View=%view{ascii} lzma -dc %f 2>/dev/null | tar tvvf -
126
122
# .tar.F - used in QNX
127
# .tar.F - used in QNX
123
regex/\.tar\.F$
128
regex/\.tar\.F$
124
	# Open=%cd %p#utar
129
	# Open=%cd %p#utar
Lines 298-303 Link Here
298
	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
303
	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
299
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
304
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
300
305
306
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
307
	Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
308
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
309
301
310
302
### Images ###
311
### Images ###
303
312
Lines 542-547 Link Here
542
	Open=gzip -dc %f | %var{PAGER:more}
551
	Open=gzip -dc %f | %var{PAGER:more}
543
	View=%view{ascii} gzip -dc %f 2>/dev/null
552
	View=%view{ascii} gzip -dc %f 2>/dev/null
544
553
554
# lzma
555
regex/\.lzma$
556
	Open=lzma -dc %f | %var{PAGER:more}
557
	View=%view{ascii} lzma -dc %f 2>/dev/null
558
545
559
546
### Default ###
560
### Default ###
547
561
(-)mc-4.6.2-pre1.orig/src/util.c (-1 / +27 lines)
Lines 935-941 Link Here
935
enum compression_type
935
enum compression_type
936
get_compression_type (int fd)
936
get_compression_type (int fd)
937
{
937
{
938
    unsigned char magic[4];
938
    unsigned char magic[16];
939
939
940
    /* Read the magic signature */
940
    /* Read the magic signature */
941
    if (mc_read (fd, (char *) magic, 4) != 4)
941
    if (mc_read (fd, (char *) magic, 4) != 4)
Lines 979-984 Link Here
979
	    return COMPRESSION_BZIP2;
979
	    return COMPRESSION_BZIP2;
980
	}
980
	}
981
    }
981
    }
982
983
    /* LZMA files; both LZMA_Alone and LZMA utils formats. The LZMA_Alone
984
     * format is used by the LZMA_Alone tool from LZMA SDK. The LZMA utils
985
     * format is the default format of LZMA utils 4.32.1 and later. */
986
    if (magic[0] < 0xE1 || (magic[0] == 0xFF && magic[1] == 'L' &&
987
	magic[2] == 'Z' && magic[3] == 'M')) {
988
	if (mc_read (fd, (char *) magic + 4, 9) == 9) {
989
	    /* LZMA utils format */
990
	    if (magic[0] == 0xFF && magic[4] == 'A' && magic[5] == 0x00)
991
		return COMPRESSION_LZMA;
992
	    /* The LZMA_Alone format has no magic bytes, thus we
993
	     * need to play a wizard. This can give false positives,
994
	     * thus the detection below should be removed when
995
	     * the newer LZMA utils format has got popular. */
996
	    if (magic[0] < 0xE1 && magic[4] < 0x20 &&
997
		((magic[10] == 0x00 && magic[11] == 0x00 &&
998
		  magic[12] == 0x00) ||
999
		 (magic[5] == 0xFF && magic[6] == 0xFF &&
1000
		  magic[7] == 0xFF && magic[8] == 0xFF &&
1001
		  magic[9] == 0xFF && magic[10] == 0xFF &&
1002
		  magic[11] == 0xFF && magic[12] == 0xFF)))
1003
		return COMPRESSION_LZMA;
1004
	}
1005
    }
1006
982
    return 0;
1007
    return 0;
983
}
1008
}
984
1009
Lines 989-994 Link Here
989
	case COMPRESSION_GZIP: return "#ugz";
1014
	case COMPRESSION_GZIP: return "#ugz";
990
	case COMPRESSION_BZIP:   return "#ubz";
1015
	case COMPRESSION_BZIP:   return "#ubz";
991
	case COMPRESSION_BZIP2:  return "#ubz2";
1016
	case COMPRESSION_BZIP2:  return "#ubz2";
1017
	case COMPRESSION_LZMA:  return "#ulzma";
992
	}
1018
	}
993
	/* Should never reach this place */
1019
	/* Should never reach this place */
994
	fprintf (stderr, "Fatal: decompress_extension called with an unknown argument\n");
1020
	fprintf (stderr, "Fatal: decompress_extension called with an unknown argument\n");
(-)mc-4.6.2-pre1.orig/src/util.h (-1 / +2 lines)
Lines 179-185 Link Here
179
	COMPRESSION_NONE,
179
	COMPRESSION_NONE,
180
	COMPRESSION_GZIP,
180
	COMPRESSION_GZIP,
181
	COMPRESSION_BZIP,
181
	COMPRESSION_BZIP,
182
	COMPRESSION_BZIP2
182
	COMPRESSION_BZIP2,
183
	COMPRESSION_LZMA
183
};
184
};
184
185
185
/* Looks for ``magic'' bytes at the start of the VFS file to guess the
186
/* Looks for ``magic'' bytes at the start of the VFS file to guess the
(-)mc-4.6.2-pre1.orig/vfs/extfs/iso9660.in (+1 lines)
Lines 29-34 Link Here
29
mcisofs_list () {
29
mcisofs_list () {
30
# left as a reminder to implement compressed image support =)
30
# left as a reminder to implement compressed image support =)
31
case "$1" in
31
case "$1" in
32
  *.lzma) MYCAT="lzma -dc";;
32
  *.bz2) MYCAT="bzip2 -dc";;
33
  *.bz2) MYCAT="bzip2 -dc";;
33
  *.gz)  MYCAT="gzip -dc";;
34
  *.gz)  MYCAT="gzip -dc";;
34
  *.z)   MYCAT="gzip -dc";;
35
  *.z)   MYCAT="gzip -dc";;
(-)mc-4.6.2-pre1.orig/vfs/extfs/lslR.in (+1 lines)
Lines 12-17 Link Here
12
12
13
mclslRfs_list () {
13
mclslRfs_list () {
14
case "$1" in
14
case "$1" in
15
  *.lzma) MYCAT="lzma -dc";;
15
  *.bz2) MYCAT="bzip2 -dc";;
16
  *.bz2) MYCAT="bzip2 -dc";;
16
  *.gz)  MYCAT="gzip -dc";;
17
  *.gz)  MYCAT="gzip -dc";;
17
  *.z)   MYCAT="gzip -dc";;
18
  *.z)   MYCAT="gzip -dc";;
(-)mc-4.6.2-pre1.orig/vfs/extfs/mailfs.in (+3 lines)
Lines 7-12 Link Here
7
7
8
$zcat="zcat";                 # gunzip to stdout
8
$zcat="zcat";                 # gunzip to stdout
9
$bzcat="bzip2 -dc";           # bunzip2 to stdout
9
$bzcat="bzip2 -dc";           # bunzip2 to stdout
10
$lzcat="lzma -dc";            # unlzma to stdout
10
$file="file";                 # "file" command
11
$file="file";                 # "file" command
11
$TZ='GMT';                    # default timezone (for Date module)
12
$TZ='GMT';                    # default timezone (for Date module)
12
13
Lines 182-187 Link Here
182
    exit 1 unless (open IN, "$zcat $mbox_qname|");
183
    exit 1 unless (open IN, "$zcat $mbox_qname|");
183
} elsif (/bzip/) {
184
} elsif (/bzip/) {
184
    exit 1 unless (open IN, "$bzcat $mbox_qname|");
185
    exit 1 unless (open IN, "$bzcat $mbox_qname|");
186
} elsif (/lzma/) {
187
    exit 1 unless (open IN, "$lzcat $mbox_qname|");
185
} else {
188
} else {
186
    exit 1 unless (open IN, "<$mbox_name");
189
    exit 1 unless (open IN, "<$mbox_name");
187
}
190
}
(-)mc-4.6.2-pre1.orig/vfs/extfs/patchfs.in (-2 / +7 lines)
Lines 12-17 Link Here
12
use File::Temp 'tempfile';
12
use File::Temp 'tempfile';
13
13
14
# standard binaries
14
# standard binaries
15
my $lzma = 'lzma';
15
my $bzip = 'bzip2';
16
my $bzip = 'bzip2';
16
my $gzip = 'gzip';
17
my $gzip = 'gzip';
17
my $fileutil = 'file';
18
my $fileutil = 'file';
Lines 70-76 Link Here
70
    my ($qfname)=(quotemeta $_[0]);
71
    my ($qfname)=(quotemeta $_[0]);
71
72
72
    $_=`$fileutil $qfname`;
73
    $_=`$fileutil $qfname`;
73
    if (/bzip/) {
74
    if (/lzma/) {
75
	return "$lzma -dc $qfname";
76
    } elsif (/bzip/) {
74
	return "$bzip -dc $qfname";
77
	return "$bzip -dc $qfname";
75
    } elsif (/gzip/) {
78
    } elsif (/gzip/) {
76
	return "$gzip -dc $qfname";
79
	return "$gzip -dc $qfname";
Lines 86-92 Link Here
86
    my ($sep) = $append ? '>>' : '>';
89
    my ($sep) = $append ? '>>' : '>';
87
90
88
    $_=`$fileutil $qfname`;
91
    $_=`$fileutil $qfname`;
89
    if (/bzip/) {
92
    if (/lzma/) {
93
	return "$lzma -c $sep $qfname";
94
    } elsif (/bzip/) {
90
	return "$bzip -c $sep $qfname";
95
	return "$bzip -c $sep $qfname";
91
    } elsif (/gzip/) {
96
    } elsif (/gzip/) {
92
	return "$gzip -c $sep $qfname";
97
	return "$gzip -c $sep $qfname";
(-)mc-4.6.2-pre1.orig/vfs/extfs/sfs.ini (+2 lines)
Lines 10-15 Link Here
10
ubz/1	bzip -d < %1 > %3
10
ubz/1	bzip -d < %1 > %3
11
bz2/1	bzip2 < %1 > %3
11
bz2/1	bzip2 < %1 > %3
12
ubz2/1	bzip2 -d < %1 > %3
12
ubz2/1	bzip2 -d < %1 > %3
13
lzma/1	lzma < %1 > %3
14
ulzma/1	lzma -d < %1 > %3
13
tar/1	tar cf %3 %1
15
tar/1	tar cf %3 %1
14
tgz/1	tar czf %3 %1
16
tgz/1	tar czf %3 %1
15
uhtml/1	lynx -force_html -dump %1 > %3
17
uhtml/1	lynx -force_html -dump %1 > %3

Return to bug 219412