1
1

* extfs/patchfs.in: Allow diffs with function names after "@@".

Don't consider an empty newline as the end of the diff.
Этот коммит содержится в:
Pavel Roskin 2002-12-19 16:51:04 +00:00
родитель 4718c1105d
Коммит 6ee35e2c55
2 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2002-12-19 Adam Byrtek <alpha@debian.org>
* extfs/patchfs.in: Allow diffs with function names after "@@".
Don't consider an empty newline as the end of the diff.
2002-12-18 Andrew V. Samoilov <sav@bcs.zp.ua>
* extfs/patchfs.in (openread): Use quoted $archive when opening

Просмотреть файл

@ -39,7 +39,7 @@ sub datetime
# print message on stderr and exit
sub error
{
print STDERR $_[0];
print STDERR $_[0], "\n";
exit 1;
}
@ -69,7 +69,7 @@ sub list
$state=1;
error "Can't parse unified diff header"
unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@\n$/);
unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@.*\n$/);
($fsrc)=/^-{3} ([^\s]+).*\n.*\n.*\n$/;
($fdst)=/^.*\n\+{3} ([^\s]+).*\n.*\n$/;
($time)=/^.*\n\+{3} [^\s]+\s+([^\t\n]+).*\n.*\n$/;
@ -108,7 +108,7 @@ sub list
}
$f=$f.".diff";
} elsif ($state==1 && !/^([+\- ]|@@)/) {
} elsif ($state==1 && !/^([+\- \n]|@@)/) {
# start of comments, end of diff contents
$npos=tell(I)-length;
printf "-rw-r--r-- 1 %s %s %d %s %s%s\n", $uid, $gid, $npos-$pos, datetime($time), $prefix, $f
@ -138,12 +138,12 @@ sub copyout
$state=1;
error "Can't parse unified diff header"
unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@\n$/);
unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@.*\n$/);
($fsrc)=/^-{3} ([^\s]+).*\n.*\n.*\n$/;
($fdst)=/^.*\n\+{3} ([^\s]+).*\n.*\n$/;
$found=1 if (($fsrc eq $file) || ($fdst eq $file));
} elsif ($state==1 && !/^([+\- ]|@@)/) {
} elsif ($state==1 && !/^([+\- \n]|@@)/) {
# start of comments, end of diff contents
last if ($found);
$state=0;