Ticket #51292: patch-fix-statistic.diff

File patch-fix-statistic.diff, 951 bytes (added by raimue (Rainer Müller), 8 years ago)
  • tardiff

    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
    
     
    116116        if(-d $file1 and -d $file2){
    117117                return 0;
    118118        }elsif(-f $file1 and -f $file2){
    119                 my $diff = `diff -u $file1 $file2`;
     119                my $diff = `diff $file1 $file2`;
    120120                if($diff){
    121121                        if($opt_stats){
    122122                                my $plus = 0;
    123123                                my $minus = 0;
    124124                                foreach my $line(split(/\n/, $diff)){
    125                                         if($line =~ /^+\ /){
     125                                        if($line =~ /^>/){
    126126                                                $plus++;
    127                                         }elsif($line =~ /^-\ /){
     127                                        }elsif($line =~ /^</){
    128128                                                $minus++;
    129129                                        }
    130130                                }