diff --git a/src/tools/copyright.pl b/src/tools/copyright.pl
new file mode 100755
index a55228d..52a7cb1
*** a/src/tools/copyright.pl
--- b/src/tools/copyright.pl
*************** use strict;
*** 11,16 ****
--- 11,17 ----
  use warnings;
  
  use File::Find;
+ use File::Basename;
  use Tie::File;
  
  my $pgdg = 'PostgreSQL Global Development Group';
*************** find({ wanted => \&wanted, no_chdir => 1
*** 25,39 ****
  
  sub wanted
  {
- 
  	# prevent corruption of git indexes by ignoring any .git/
! 	if ($_ eq '.git')
  	{
  		$File::Find::prune = 1;
  		return;
  	}
  
! 	return if !-f $File::Find::name || -l $File::Find::name;
  
  	# skip file names with binary extensions
  	# How are these updated?  bjm 2012-01-02
--- 26,39 ----
  
  sub wanted
  {
  	# prevent corruption of git indexes by ignoring any .git/
! 	if (basename($_) eq '.git')
  	{
  		$File::Find::prune = 1;
  		return;
  	}
  
! 	return if ! -f $File::Find::name || -l $File::Find::name;
  
  	# skip file names with binary extensions
  	# How are these updated?  bjm 2012-01-02
*************** sub wanted
*** 46,59 ****
  	{
  
  		# We only care about lines with a copyright notice.
! 		next unless $line =~ m/$cc . *$pgdg /;
  
! 		# We stop when we've done one substitution.  This is both for
! 		# efficiency and, at least in the case of this program, for
! 		# correctness.
! 		last if $line =~ m/$cc.*$year.*$pgdg/;
! 		last if $line =~ s/($cc\d{4})(, $pgdg)/$1-$year$2/;
! 		last if $line =~ s/($cc\d{4})-\d{4}(, $pgdg)/$1-$year$2/;
  	}
  	untie @lines;
  }
--- 46,61 ----
  	{
  
  		# We only care about lines with a copyright notice.
! 		next unless $line =~ m/$cc.*$pgdg/;
  
! 		# Skip line if already matches the current year; if not
! 		# we get $year-$year, e.g. 2012-2012
! 		next if $line =~ m/$cc$year, $pgdg/;
! 
! 		# We process all lines because some files have copyright
! 		# strings embedded in them, e.g. src/bin/psql/help.c
! 		$line =~ s/($cc\d{4})(, $pgdg)/$1-$year$2/;
! 		$line =~ s/($cc\d{4})-\d{4}(, $pgdg)/$1-$year$2/;
  	}
  	untie @lines;
  }
