#!/usr/bin/perl

# usage:
# tools/dev/vms-patch < the_patch | patch -p0
# or some such

use warnings;
use strict;

# mangle vms-ish files to std patch format
# --- config/auto/snprintf.pm;1   Wed Aug 30 19:03:40 2006
# +++ config/auto/snprintf.pm;    Sun Sep  3 23:21:26 2006

while (<>) {
    m/^(---\s+.*?);\d+(\s+.*)/ && do {
	print "$1.old $2\n";
	next;
    };
    m/^(\+\+\+\s+.*?);(\s+.*)/ && do {
	print "$1 $2\n";
	next;
    };
    print;
}

