#!/usr/bin/perl
# Copyright (C) 2004-2008, Parrot Foundation.
# $Id: vms-patch 36833 2009-02-17 20:09:26Z allison $

# 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;
}

