ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/example-decoder
(Generate patch)

Comparing Convert-UUlib/example-decoder (file contents):
Revision 1.15 by root, Mon Oct 13 12:12:56 2008 UTC vs.
Revision 1.17 by root, Mon Oct 13 12:14:00 2008 UTC

40# the following non-trivial FileNameCallback takes care 40# the following non-trivial FileNameCallback takes care
41# of some subject lines not detected properly by uulib: 41# of some subject lines not detected properly by uulib:
42SetFileNameCallback sub { 42SetFileNameCallback sub {
43 return unless $_[1]; # skip "Re:"-plies et al. 43 return unless $_[1]; # skip "Re:"-plies et al.
44 local $_ = $_[0]; 44 local $_ = $_[0];
45
46 return $1 if /(\S+\s+IMG_\d+.jpg)/i;
47 45
48 # the following rules are rather effective on some newsgroups, 46 # the following rules are rather effective on some newsgroups,
49 # like alt.binaries.games.anime, where non-mime, uuencoded data 47 # like alt.binaries.games.anime, where non-mime, uuencoded data
50 # is very common 48 # is very common
51 49
102 100
103 print $uu->filename; 101 print $uu->filename;
104 102
105 $uu->remove_temp; 103 $uu->remove_temp;
106 104
107 if (my $err = $uu->decode ()) { 105 if (my $err = $uu->decode) {
108 print ", ", strerror $err, "\n"; 106 print ", ", strerror $err, "\n";
109 } else { 107 } else {
110 print ", saved as uudst/", $uu->filename, "\n"; 108 print ", saved as uudst/", $uu->filename, "\n";
111 } 109 }
112} 110}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines