while (<DIFF>) {
if (($os, $ol, $ns, $nl) = /@@ -(\d+)(?:,(\d+)|) \+(\d+)(?:,(\d+)|) @@/) { ##value is false
# These codes are not executed
$os++ if $ol eq '0';
$ns++ if $nl eq '0';
$ol = 1 unless defined($ol);
Could some lxr or perl guru help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
"diff markup" funciton failed to make a proper diff. Its HTML output was simply listings of two files side by side. And the alignment is poor.
I digged into the problem. and I found
unless (open(DIFF, "-|")) {
open(STDERR, ">&STDOUT");
exec('diff', '-U0', $origtemp, $difftemp);
print "*** Diff subprocess died unexpextedly: $!\n";
exit;
}
my ($os, $ol, $ns, $nl, $ms, $ml, $bo, $ofs, $dir, %orig, %new, %chg);
# I found <DIFF> is empty
while (<DIFF>) {
if (($os, $ol, $ns, $nl) = /@@ -(\d+)(?:,(\d+)|) \+(\d+)(?:,(\d+)|) @@/) { ##value is false
# These codes are not executed
$os++ if $ol eq '0';
$ns++ if $nl eq '0';
$ol = 1 unless defined($ol);
Could some lxr or perl guru help?
<DIFF> does have some output. No ouput is due to that I compared two file which are the same.
But then, the coloumn view is ugly. They're not aligned properly.
Ok, i found out the cause of un-aligned display. It was because my source codes has dos-style new line.