1*1debfc3dSmrg#! /usr/bin/perl -wi 2*1debfc3dSmrg# Fix up the output of cvs diff -c so that it works with patch. 3*1debfc3dSmrg# We do this by propagating the full pathname from the Index: line 4*1debfc3dSmrg# into the diff itself. 5*1debfc3dSmrg# 6*1debfc3dSmrg# Thrown together by Jason Merrill <jason@cygnus.com> 7*1debfc3dSmrg 8*1debfc3dSmrgwhile (<>) 9*1debfc3dSmrg{ 10*1debfc3dSmrg if (/^Index: (.*)/) 11*1debfc3dSmrg { 12*1debfc3dSmrg $full = $1; 13*1debfc3dSmrg print; 14*1debfc3dSmrg for (1..7) 15*1debfc3dSmrg { 16*1debfc3dSmrg $_ = <>; 17*1debfc3dSmrg s/^([-+*]{3}) [^\t]+\t/$1 $full\t/ 18*1debfc3dSmrg unless m{ /dev/null\t}; 19*1debfc3dSmrg print; 20*1debfc3dSmrg } 21*1debfc3dSmrg } 22*1debfc3dSmrg else 23*1debfc3dSmrg { 24*1debfc3dSmrg print; 25*1debfc3dSmrg } 26*1debfc3dSmrg} 27