4
# fixdiff.pl - fix line endings in svn diff to match lineending of existing files
6
# perl fixdiff.pl a.diff | patch -p0 ...
8
# parse diff and modify the hunks to match the line ending of the target files
9
# This is useful, when the compared trees to generate the diff are on a
10
# different architecture than that of the one where the patch is to be
13
# Copyright 2008 J�rgen E. Fischer <jef@norbit.de>
22
if( /^Index: (.*)\n/ ) {
29
$dos=1 if scalar(<F>) =~ /\r\n$/;
32
#warn "$file in DOS mode!" if $dos;
34
warn "$file not found.";
39
} elsif(/^===================================================================/ ||
44
} elsif($dos && !/\r\n$/) {
47
} elsif(!$dos && /\r\n$/) {