eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
  & eval 'exec perl -S $0 $argv:q'
  if 0;
#  THE PRECEEDING STUFF EXECS perl via $PATH
# -*-Fundamental-*-

my $path = shift;

open(FO, "<$path") || die "open(\"<$path\"): $!";
open(FN, ">$path.new") || die "open(\">$path.new\"): $!";

# Hmmm. Should we be more discrimiating about where we are in the RCS
# file when we clobber these, so as to avoid inadvertantly whacking
# revision content!?
#

while (<FO>)
  {
#    if (/^expand\s+\@c\@;/) { next; }
#    if (/^expand\s+\@bx\@/) { $_ =~ s/\@bx\@/\@b\@/; } # Fall through
    if (/^mergepoint\d+\s+.*;$/) { next; }    
    if (/^filename\s+.*;$/) { next; }    
    if (/^permissions\s+\d+;$/) { next; }    
    if (/^commitid\s+[a-f\d]+;$/) { next; }    
    if (/^kopt\s+[a-z]+;$/) { next; }    
    if (/^deltatype\s+[a-z]+;$/) { next; }    
    print FN;
    if (/^desc$/) { last; }
  }

while (<FO>)
  { print FN; }

rename($path, "$path.old") || die;
rename("$path.new", "$path") || die;

print STDERR "$path\n";

exit 0;