On Wed, Dec 18, 2002 at 09:26:05PM +0200, Andrew V. Samoilov wrote: > You can use ideas from attached file. I eliminated all tell() call and > calculate position itself by adding current line length to some
This wasn't necessary at all. The problem was somewhere else: patchfs treated empty line as the diff boundary, so the size was broken. The fix was really simple. Pavel, could you apply the attached patch please, not Andrew's one. Andrew you could see how it looks for me here: http://www.rpg-portal.pl/alpha/mc-patchfs.png If the size is still wrong on your system - let me know, maybe your system has broken pipes... And thanks for your interest in patchfs. Regards alpha -- _.|._ |_ _. : Adam Byrtek, alpha@(irc.pl|debian.org) (_|||_)| |(_| : gg 1802819, pgp 0xB25952C0 | : jid alpha.pl(at)jabber.org
Index: patchfs.in =================================================================== RCS file: /cvs/gnome/mc/vfs/extfs/patchfs.in,v retrieving revision 1.7 diff -u -r1.7 patchfs.in --- patchfs.in 13 Dec 2002 05:22:09 -0000 1.7 +++ patchfs.in 18 Dec 2002 22:40:51 -0000 @@ -108,7 +108,7 @@ } $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 @@ -143,7 +143,7 @@ ($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;