Upstream: https://anonscm.debian.org/cgit/collab-maint/tardiff.git/tree/debian/patches/fix-statistic.diff
Description: Fix calculation of statistics (option -s)
Using normal instead of unique diff is far easier to parse
unambiguously.
Author: Axel Beckert <abe@debian.org>
Bug-Debian: https://bugs.debian.org/802098
|
|
|
116 | 116 | if(-d $file1 and -d $file2){ |
117 | 117 | return 0; |
118 | 118 | }elsif(-f $file1 and -f $file2){ |
119 | | my $diff = `diff -u $file1 $file2`; |
| 119 | my $diff = `diff $file1 $file2`; |
120 | 120 | if($diff){ |
121 | 121 | if($opt_stats){ |
122 | 122 | my $plus = 0; |
123 | 123 | my $minus = 0; |
124 | 124 | foreach my $line(split(/\n/, $diff)){ |
125 | | if($line =~ /^+\ /){ |
| 125 | if($line =~ /^>/){ |
126 | 126 | $plus++; |
127 | | }elsif($line =~ /^-\ /){ |
| 127 | }elsif($line =~ /^</){ |
128 | 128 | $minus++; |
129 | 129 | } |
130 | 130 | } |