blob: af5f497af850d8a65675597cc48c69ed6a8d6816 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001use strict;
2
3my $backup = $/;
4undef $/;
5my $input = <>;
6$/ = $backup;
7
8my @text = split(/[\n\r]+/, $input);
9my $flag_7z = 0;
10foreach my $line (@text)
11{
12 next if ($line eq "");
13 if (($line =~ /^\s*7-Zip/i) || ($line =~ /^\s*Listing archive/i))
14 {
15 $flag_7z = 1;
16 next;
17 }
18 if ($flag_7z)
19 {
20 if ($line =~ /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(.+)\s*$/)
21 {
22 $line = $6;
23 }
24 else
25 {
26 next;
27 }
28 }
29 $line =~ s/\\/\//g;
30 next if ($line =~ /\/$/);
31 next if (-d $line);
32 $line =~ s/ /\\?/g;
33 $line =~ s/\#/\\\\\\#/g;
34 print $line . "\n";
35}