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.1.orig/edit/edit.c (+3 lines)
Lines 179-184 Link Here
179
} all_filters[] = {
179
} all_filters[] = {
180
180
181
    {
181
    {
182
	"lzma -cd %s 2>&1", "lzma > %s", ".lzma"
183
    },
184
    {
182
	"bzip2 -cd %s 2>&1", "bzip2 > %s", ".bz2"
185
	"bzip2 -cd %s 2>&1", "bzip2 > %s", ".bz2"
183
    },
186
    },
184
    {
187
    {
(-)mc-4.6.1.orig/lib/mc.ext.in (+14 lines)
Lines 119-124 Link Here
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 283-288 Link Here
283
	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
288
	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
284
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
289
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
285
290
291
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
292
	Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
293
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
294
286
295
287
### Images ###
296
### Images ###
288
297
Lines 527-532 Link Here
527
	Open=gzip -dc %f | %var{PAGER:more}
536
	Open=gzip -dc %f | %var{PAGER:more}
528
	View=%view{ascii} gzip -dc %f 2>/dev/null
537
	View=%view{ascii} gzip -dc %f 2>/dev/null
529
538
539
# lzma
540
regex/\.lzma$
541
	Open=lzma -dc %f | %var{PAGER:more}
542
	View=%view{ascii} lzma -dc %f 2>/dev/null
543
530
544
531
### Default ###
545
### Default ###
532
546
(-)mc-4.6.1.orig/src/util.c (-1 / +27 lines)
Lines 900-906 Link Here
900
 * Warning: this function moves the current file pointer */
900
 * Warning: this function moves the current file pointer */
901
int get_compression_type (int fd)
901
int get_compression_type (int fd)
902
{
902
{
903
    unsigned char magic[4];
903
    unsigned char magic[16];
904
904
905
    /* Read the magic signature */
905
    /* Read the magic signature */
906
    if (mc_read (fd, (char *) magic, 4) != 4)
906
    if (mc_read (fd, (char *) magic, 4) != 4)
Lines 944-949 Link Here
944
	    return COMPRESSION_BZIP2;
944
	    return COMPRESSION_BZIP2;
945
	}
945
	}
946
    }
946
    }
947
948
    /* LZMA files; both LZMA_Alone and LZMA utils formats. The LZMA_Alone
949
     * format is used by the LZMA_Alone tool from LZMA SDK. The LZMA utils
950
     * format is the default format of LZMA utils 4.32.1 and later. */
951
    if (magic[0] < 0xE1 || (magic[0] == 0xFF && magic[1] == 'L' &&
952
	magic[2] == 'Z' && magic[3] == 'M')) {
953
	if (mc_read (fd, (char *) magic + 4, 9) == 9) {
954
	    /* LZMA utils format */
955
	    if (magic[0] == 0xFF && magic[4] == 'A' && magic[5] == 0x00)
956
		return COMPRESSION_LZMA;
957
	    /* The LZMA_Alone format has no magic bytes, thus we
958
	     * need to play a wizard. This can give false positives,
959
	     * thus the detection below should be removed when
960
	     * the newer LZMA utils format has got popular. */
961
	    if (magic[0] < 0xE1 && magic[4] < 0x20 &&
962
		((magic[10] == 0x00 && magic[11] == 0x00 &&
963
		  magic[12] == 0x00) ||
964
		 (magic[5] == 0xFF && magic[6] == 0xFF &&
965
		  magic[7] == 0xFF && magic[8] == 0xFF &&
966
		  magic[9] == 0xFF && magic[10] == 0xFF &&
967
		  magic[11] == 0xFF && magic[12] == 0xFF)))
968
		return COMPRESSION_LZMA;
969
	}
970
    }
971
947
    return 0;
972
    return 0;
948
}
973
}
949
974
Lines 954-959 Link Here
954
	case COMPRESSION_GZIP: return "#ugz";
979
	case COMPRESSION_GZIP: return "#ugz";
955
	case COMPRESSION_BZIP:   return "#ubz";
980
	case COMPRESSION_BZIP:   return "#ubz";
956
	case COMPRESSION_BZIP2:  return "#ubz2";
981
	case COMPRESSION_BZIP2:  return "#ubz2";
982
	case COMPRESSION_LZMA:  return "#ulzma";
957
	}
983
	}
958
	/* Should never reach this place */
984
	/* Should never reach this place */
959
	fprintf (stderr, "Fatal: decompress_extension called with an unknown argument\n");
985
	fprintf (stderr, "Fatal: decompress_extension called with an unknown argument\n");
(-)mc-4.6.1.orig/src/util.h (-1 / +2 lines)
Lines 169-175 Link Here
169
	COMPRESSION_NONE,
169
	COMPRESSION_NONE,
170
	COMPRESSION_GZIP,
170
	COMPRESSION_GZIP,
171
	COMPRESSION_BZIP,
171
	COMPRESSION_BZIP,
172
	COMPRESSION_BZIP2
172
	COMPRESSION_BZIP2,
173
	COMPRESSION_LZMA
173
};
174
};
174
175
175
int get_compression_type (int fd);
176
int get_compression_type (int fd);
(-)mc-4.6.1.orig/vfs/extfs/iso9660.in (+1 lines)
Lines 25-30 Link Here
25
mcisofs_list () {
25
mcisofs_list () {
26
# left as a reminder to implement compressed image support =)
26
# left as a reminder to implement compressed image support =)
27
case "$1" in
27
case "$1" in
28
  *.lzma) MYCAT="lzma -dc";;
28
  *.bz2) MYCAT="bzip2 -dc";;
29
  *.bz2) MYCAT="bzip2 -dc";;
29
  *.gz)  MYCAT="gzip -dc";;
30
  *.gz)  MYCAT="gzip -dc";;
30
  *.z)   MYCAT="gzip -dc";;
31
  *.z)   MYCAT="gzip -dc";;
(-)mc-4.6.1.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.1.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 132-137 Link Here
132
    exit 1 unless (open IN, "$zcat $mbox_qname|");
133
    exit 1 unless (open IN, "$zcat $mbox_qname|");
133
} elsif (/bzip/) {
134
} elsif (/bzip/) {
134
    exit 1 unless (open IN, "$bzcat $mbox_qname|");
135
    exit 1 unless (open IN, "$bzcat $mbox_qname|");
136
} elsif (/lzma/) {
137
    exit 1 unless (open IN, "$lzcat $mbox_qname|");
135
} else {
138
} else {
136
    exit 1 unless (open IN, "<$mbox_name");
139
    exit 1 unless (open IN, "<$mbox_name");
137
}
140
}
(-)mc-4.6.1.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.1.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