|
|
|
@ -106,19 +106,38 @@ while (<>) |
|
|
|
|
(?<end>.*) |
|
|
|
|
} |
|
|
|
|
{ |
|
|
|
|
# Fill line to the same length (if appropriate); we insert three |
|
|
|
|
# spaces, the string `(C)', a `-', and the current year. |
|
|
|
|
my $space = length($+{space1}) |
|
|
|
|
+ length($+{space2}) |
|
|
|
|
+ length($+{space3}) |
|
|
|
|
- (length($year) + length("(C)") + 3 + 1); |
|
|
|
|
if ($+{first} < $year) |
|
|
|
|
{ |
|
|
|
|
# Fill line to the same length (if appropriate); we insert three |
|
|
|
|
# spaces, the string `(C)', a `-', and the current year. |
|
|
|
|
my $space = length($+{space1}) |
|
|
|
|
+ length($+{space2}) |
|
|
|
|
+ length($+{space3}) |
|
|
|
|
- (length($year) + length("(C)") + 3 + 1); |
|
|
|
|
|
|
|
|
|
print "$+{begin}"; |
|
|
|
|
print "Copyright\ (C)\ $+{first}-$year\ by"; |
|
|
|
|
# If $space is negative this inserts nothing. |
|
|
|
|
print ' ' x $space if length($+{end}); |
|
|
|
|
print "$+{end}\n"; |
|
|
|
|
$replaced = 1; |
|
|
|
|
print "$+{begin}"; |
|
|
|
|
print "Copyright\ (C)\ $+{first}-$year\ by"; |
|
|
|
|
# If $space is negative this inserts nothing. |
|
|
|
|
print ' ' x $space if length($+{end}); |
|
|
|
|
print "$+{end}\n"; |
|
|
|
|
$replaced = 1; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
# Fill line to the same length (if appropriate); we insert three |
|
|
|
|
# spaces and the string `(C)'. |
|
|
|
|
my $space = length($+{space1}) |
|
|
|
|
+ length($+{space2}) |
|
|
|
|
+ length($+{space3}) |
|
|
|
|
- (length("(C)") + 3); |
|
|
|
|
|
|
|
|
|
print "$+{begin}"; |
|
|
|
|
print "Copyright\ (C)\ $+{first}\ by"; |
|
|
|
|
# If $space is negative this inserts nothing. |
|
|
|
|
print ' ' x $space if length($+{end}); |
|
|
|
|
print "$+{end}\n"; |
|
|
|
|
$replaced = 1; |
|
|
|
|
} |
|
|
|
|
}ex |
|
|
|
|
|| |
|
|
|
|
# Otherwise print line unaltered. |
|
|
|
|