blob: f81397fad6f5445f2ebec2054efb5f6d66bf1dec (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/perl
#
# Strip whitespace on the end of GNU unified diff insertion lines.
#
# Usage:
# cat foo | stripspace | patch -p1
# stripspace foo | patch -p1
#
# Code fragment taken from the ARM Linux patch system, Copyright
# (C) Russell King, All Rights Reserved.
#
# This script:
#
# Copyright (C) 2002 Russell King, All Rights Reserved.
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
while (<>) {
chomp;
s/\s+$// if m/^\+/;
print "$_\n";
}
|