Algorithm::Diff: check whether files really have changed

git-svn-id: https://zeitsenke.de/svn/SyncEvolution/trunk@334 15ad00c4-1369-45f4-8270-35d70d36bdcd
This commit is contained in:
Patrick Ohly 2007-03-25 18:05:51 +00:00
parent f471c872ef
commit aaeb5a4105
1 changed files with 4 additions and 1 deletions

View File

@ -225,7 +225,7 @@ if($#ARGV > 1) {
# Produce output where each line is marked as old (aka remove) with o,
# as new (aka added) with n, and as unchanged with u at the beginning.
# This allows simpler processing below.
my $res = 1;
my $res = 0;
if (0) {
# $_ = `diff "--old-line-format=o %L" "--new-line-format=n %L" "--unchanged-line-format=u %L" "$normal1" "$normal2"`;
# $res = $?;
@ -239,11 +239,14 @@ if($#ARGV > 1) {
my ($type, $left, $right) = @{$hunk};
if ($type eq "-") {
push @_, "o $left";
$res = 1;
} elsif ($type eq "+") {
push @_, "n $right";
$res = 1;
} elsif ($type eq "c") {
push @_, "o $left";
push @_, "n $right";
$res = 1;
} else {
push @_, "u $left";
}