Line 0
Link Here
|
|
|
1 |
--- lib/PatchReader/Raw.pm.orig 2014-09-20 06:54:09 UTC |
2 |
+++ lib/PatchReader/Raw.pm |
3 |
@@ -41,7 +41,7 @@ |
4 |
return if $line =~ /^\?/; |
5 |
|
6 |
# patch header parsing |
7 |
- if ($line =~ /^---\s*([\S ]+)\s*\t([^\t\r\n]*)\s*(\S*)/) { |
8 |
+ if ($line =~ /^---\s+([\S ]+)\s*?(?:\t([^\t\r\n]*)\s*(\S*))?/) { |
9 |
$this->_maybe_end_file(); |
10 |
|
11 |
if ($1 eq "/dev/null") { |
12 |
@@ -54,9 +54,12 @@ |
13 |
|
14 |
$this->{IN_HEADER} = 1; |
15 |
|
16 |
- } elsif ($line =~ /^\+\+\+\s*([\S ]+)\s*\t([^\t\r\n]*)(\S*)/) { |
17 |
+ } elsif ($line =~ /^\+\+\+\s+([\S ]+)\s*?(?:\t([^\t\r\n]*)(\S*))?/) { |
18 |
if ($1 eq "/dev/null") { |
19 |
$this->{FILE_STATE}{is_remove} = 1; |
20 |
+ } else { |
21 |
+ $this->{FILE_STATE}{filename} = $1; |
22 |
} |
23 |
$this->{FILE_STATE}{new_date_str} = $2; |
24 |
$this->{FILE_STATE}{new_revision} = $3 if $3; |