-#!/usr/bin/perl -w -pi
+#!/usr/bin/perl -0777 -pi
# Update an FSF copyright year list to include the current year.
-my $VERSION = '2009-06-04 08:53'; # UTC
+my $VERSION = '2009-07-29.08:18'; # UTC
# Copyright (C) 2009 Free Software Foundation
#
# Written by Jim Meyering
use strict;
+use warnings;
-my ($sec, $min, $hour, $mday, $month, $this_year) = localtime (time());
-$this_year += 1900;
-
+my $this_year;
my $holder = 'Free Software Foundation';
-if (/([- ])((?:\d\d)?\d\d)\s+$holder/)
+BEGIN {
+ my ($sec, $min, $hour, $mday, $month, $year) = localtime (time());
+ $this_year = $year + 1900;
+}
+
+if (/([- ])((?:\d\d)?\d\d)(\s+$holder)/s)
{
- my ($sep, $last_c_year) = ($1, $2);
+ my ($sep, $last_c_year, $rest) = ($1, $2, $3);
# Handle two-digit year numbers like "98" and "99".
$last_c_year <= 99
{
if ($sep eq '-' && $last_c_year + 1 == $this_year)
{
- s//-$this_year $holder/;
+ s//-$this_year$rest/;
}
elsif ($sep eq ' ' && $last_c_year + 1 == $this_year)
{
- s// $last_c_year-$this_year $holder/;
+ s// $last_c_year-$this_year$rest/;
}
else
{
- s//$sep$last_c_year, $this_year $holder/;
+ s//$sep$last_c_year, $this_year$rest/;
}
}
}
# indent-tabs-mode: nil
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "my $VERSION = '"
-# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "'; # UTC"
# End: