Thread (15 messages) flat view 15 messages, 5 authors, 2016-06-15

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

From: Martin Langhoff <hidden>
Date: 2016-06-15 22:42:27
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On 5/24/06, Linus Torvalds [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help