freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] * src/tools/update-copyright-year: Fix


From: Werner Lemberg
Subject: [Git][freetype/freetype][master] * src/tools/update-copyright-year: Fix single-year entry handling.
Date: Sat, 13 Feb 2021 08:21:56 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

2 changed files:

Changes:

  • ChangeLog
    1
    +2021-02-13  Werner Lemberg  <wl@gnu.org>
    
    2
    +
    
    3
    +	* src/tools/update-copyright-year: Fix single-year entry handling.
    
    4
    +
    
    5
    +	The fix from 2021-01-17 didn't cover the case where the year to be
    
    6
    +	updated is identical to the current year.
    
    7
    +
    
    1 8
     2021-02-13  Werner Lemberg  <wl@gnu.org>
    
    2 9
     
    
    3 10
     	Add new function `FT_Get_Transform`.
    

  • src/tools/update-copyright-year
    ... ... @@ -106,19 +106,38 @@ while (<>)
    106 106
             (?<end>.*)
    
    107 107
           }
    
    108 108
           {
    
    109
    -        # Fill line to the same length (if appropriate); we insert three
    
    110
    -        # spaces, the string `(C)', a `-', and the current year.
    
    111
    -        my $space = length($+{space1})
    
    112
    -                    + length($+{space2})
    
    113
    -                    + length($+{space3})
    
    114
    -                    - (length($year) + length("(C)") + 3 + 1);
    
    109
    +        if ($+{first} < $year)
    
    110
    +        {
    
    111
    +          # Fill line to the same length (if appropriate); we insert three
    
    112
    +          # spaces, the string `(C)', a `-', and the current year.
    
    113
    +          my $space = length($+{space1})
    
    114
    +                      + length($+{space2})
    
    115
    +                      + length($+{space3})
    
    116
    +                      - (length($year) + length("(C)") + 3 + 1);
    
    115 117
     
    
    116
    -        print "$+{begin}";
    
    117
    -        print "Copyright\ (C)\ $+{first}-$year\ by";
    
    118
    -        # If $space is negative this inserts nothing.
    
    119
    -        print ' ' x $space if length($+{end});
    
    120
    -        print "$+{end}\n";
    
    121
    -        $replaced = 1;
    
    118
    +          print "$+{begin}";
    
    119
    +          print "Copyright\ (C)\ $+{first}-$year\ by";
    
    120
    +          # If $space is negative this inserts nothing.
    
    121
    +          print ' ' x $space if length($+{end});
    
    122
    +          print "$+{end}\n";
    
    123
    +          $replaced = 1;
    
    124
    +        }
    
    125
    +        else
    
    126
    +        {
    
    127
    +          # Fill line to the same length (if appropriate); we insert three
    
    128
    +          # spaces and the string `(C)'.
    
    129
    +          my $space = length($+{space1})
    
    130
    +                      + length($+{space2})
    
    131
    +                      + length($+{space3})
    
    132
    +                      - (length("(C)") + 3);
    
    133
    +
    
    134
    +          print "$+{begin}";
    
    135
    +          print "Copyright\ (C)\ $+{first}\ by";
    
    136
    +          # If $space is negative this inserts nothing.
    
    137
    +          print ' ' x $space if length($+{end});
    
    138
    +          print "$+{end}\n";
    
    139
    +          $replaced = 1;
    
    140
    +        }
    
    122 141
           }ex
    
    123 142
         ||
    
    124 143
         # Otherwise print line unaltered.
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]