Subject: | small patch |
Show quoted text
> Please review this patch (for last CVS that I downloaded today)
> (again - to minimize warning messages)
>
>
> Let me know please if my changes there are wrong.
>
> Please take a look to "binmode $fh, ':utf8'". It disables
> warnings "Wide character in print at ...." under Perl5.8...
> Will it be a problem under other perl versions? I hope, that
> not.
diff -Naur test2/i386-linux/Apache/AxKit/Language/XSP/SimpleTaglib.pm 5.8.0/i386-linux/Apache/AxKit/Language/XSP/SimpleTaglib.pm
--- test2/i386-linux/Apache/AxKit/Language/XSP/SimpleTaglib.pm 2003-01-29 07:35:50 +0600
+++ 5.8.0/i386-linux/Apache/AxKit/Language/XSP/SimpleTaglib.pm 2003-03-26 16:20:40 +0600
@@ -12,7 +12,7 @@
# utility functions
sub makeSingleQuoted($) { $_ = shift; s/([\\%])/\\$1/g; 'q%'.$_.'%'; }
-sub _makeAttributeQuoted(@) { $_ = join(',',@_); s/([\\()])/\\\1/g; '('.$_.')'; }
+sub _makeAttributeQuoted(@) { $_ = join(',',@_); s/([\\()])/\\$1/g; '('.$_.')'; }
sub makeVariableName($) { $_ = shift; s/[^a-zA-Z0-9]/_/g; $_; }
# perl attribute handlers
@@ -101,7 +101,7 @@
foreach my $a (@attr) {
#warn("attr: $a");
my ($attr,$param) = ($a =~ m/([^(]*)(?:\((.*)\))?$/);
- $param = eval "q($param)";
+ $param = defined($param) ? eval "q($param)" : "";
my @param = split(/,/,$param);
if ($attr eq 'expr') {
diff -Naur test2/i386-linux/Apache/AxKit/Language/XSP.pm 5.8.0/i386-linux/Apache/AxKit/Language/XSP.pm
--- test2/i386-linux/Apache/AxKit/Language/XSP.pm 2003-03-26 16:13:55 +0600
+++ 5.8.0/i386-linux/Apache/AxKit/Language/XSP.pm 2003-03-26 16:21:46 +0600
@@ -132,7 +132,7 @@
$interm_prefix = $AxKit::Cfg->TraceIntermediate.'/'.$interm_prefix;
my $fh = Apache->gensym();
if (open($fh, '>'.$interm_prefix.'.XSP')) {
- print($fh $to_eval);
+ binmode $fh, ':utf8'; print($fh $to_eval);
} else {
AxKit::Debug(1,"could not open $interm_prefix.XSP for writing: $!");
}
@@ -332,7 +332,7 @@
sub location_debug_string {
my ($e, $file, $line) = @_;
- return '' if !$e->{XSP_Debug} || $file =~ m/^AxKit::XSP::Core::/;
+ return '' if !$e->{XSP_Debug} || ($file && ($file =~ m/^AxKit::XSP::Core::/));
(undef, $file, $line) = caller if (@_ < 3);
$file =~ s/"/''/;
$file =~ s/\n/ /;
diff -Naur test2/i386-linux/AxKit.pm 5.8.0/i386-linux/AxKit.pm
--- test2/i386-linux/AxKit.pm 2003-03-26 16:13:45 +0600
+++ 5.8.0/i386-linux/AxKit.pm 2003-03-26 16:17:57 +0600
@@ -784,7 +784,7 @@
$xmlstr = "<?xml version='1.0'?>\n<empty reason='no data found'/>\n";
}
}
- print($fh $xmlstr);
+ binmode($fh, ":utf8"); print($fh $xmlstr);
close($fh);
$interm_count++;
} else {