projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://se.aminet.net/pub/Linux/distributions/slackware/slackware-10.1/source/xap...
[xscreensaver]
/
driver
/
xscreensaver-getimage-file
diff --git
a/driver/xscreensaver-getimage-file
b/driver/xscreensaver-getimage-file
index 749fe56b5b8aa3858b3e86ef4efd48fb7f778961..860ffc8a82f5c98cc8e46d995c4306d760e61b83 100755
(executable)
--- a/
driver/xscreensaver-getimage-file
+++ b/
driver/xscreensaver-getimage-file
@@
-33,9
+33,12
@@
use Fcntl;
use POSIX ':fcntl_h'; # S_ISLNK was here in Perl 5.6
import Fcntl ':mode' unless defined &S_ISLNK; # but it is here in Perl 5.8
use POSIX ':fcntl_h'; # S_ISLNK was here in Perl 5.6
import Fcntl ':mode' unless defined &S_ISLNK; # but it is here in Perl 5.8
+use bytes; # Larry can take Unicode and shove it up his ass sideways.
+ # Perl 5.8.0 causes us to start getting incomprehensible
+ # errors about UTF-8 all over the place without this.
my $progname = $0; $progname =~ s@.*/@@g;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.1
6
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.1
8
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $verbose = 0;
my $verbose = 0;
@@
-317,7
+320,7
@@
sub jpeg_size {
#
sub png_size {
my ($body) = @_;
#
sub png_size {
my ($body) = @_;
- return () unless ($body =~ m/^\211PNG\r/);
+ return () unless ($body =~ m/^\211PNG\r/
s
);
my ($bits) = ($body =~ m/^.{12}(.{12})/s);
return () unless defined ($bits);
return () unless ($bits =~ /^IHDR/);
my ($bits) = ($body =~ m/^.{12}(.{12})/s);
return () unless defined ($bits);
return () unless ($bits =~ /^IHDR/);
@@
-349,6
+352,7
@@
sub image_file_size {
print STDERR "$progname: $file: $!\n" if ($verbose);
return undef;
}
print STDERR "$progname: $file: $!\n" if ($verbose);
return undef;
}
+ binmode (IN); # Larry can take Unicode and shove it up his ass sideways.
while (<IN>) {
$body .= $_;
last if (length($body) > 1024 * 100); # the first 100k should be enough
while (<IN>) {
$body .= $_;
last if (length($body) > 1024 * 100); # the first 100k should be enough