Re: [PATCH 2/2] cvsimport: cleanup commit function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/24/06, Linus Torvalds <torvalds@xxxxxxxx> wrote:
Martin, that problem seems to go away when I initialize $res to 0 in
_fetchfile.

I don't know perl, and maybe local variables are pre-initialized to empty.

It's entirely possible that the fact that it now seems to work for me is
purely timing-related, since I also ended up using "-P cvsps-output" to
avoid having a huge cvsps binary in memory at the same time.

Strange! Cannot repro here with v5.8.8 (debian/etch 5.8.8-4) but
initialising it doesn't hurt, so let's do it:

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index ace7087..abbfd0b 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -371,7 +371,7 @@ sub file {
}
sub _fetchfile {
       my ($self, $fh, $cnt) = @_;
-       my $res;
+       my $res = 0;
       my $bufsize = 1024 * 1024;
       while($cnt) {
           if ($bufsize > $cnt) {

cheers,


martin
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]