diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-27 18:58:27 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-27 18:58:27 +0000 |
commit | cfdc44f9c19b9247c0619b1dcd698d8ec4992415 (patch) | |
tree | 61887a13293e967a2e8afd4d29e50a45d8bc0b13 /usr.bin | |
parent | 01ad46a801b8d06bb042bac1a5a17c217bc8931c (diff) |
We need to initialize clen to 0 each time through diffreg() for
when diffreg() is called multiple times (i.e. in directory mode).
Fixes a hang I saw doing "diff -r" of two large directory trees.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/diff/diffreg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 85f4e45fcdd..33a2cd31581 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.43 2003/07/27 07:39:52 otto Exp $ */ +/* $OpenBSD: diffreg.c,v 1.44 2003/07/27 18:58:26 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -65,7 +65,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.43 2003/07/27 07:39:52 otto Exp $"; +static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.44 2003/07/27 18:58:26 millert Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -418,6 +418,7 @@ notsame: class = erealloc(class, (slen[0] + 2) * sizeof(int)); klist = emalloc((slen[0] + 2) * sizeof(int)); + clen = 0; clistlen = 100; clist = emalloc(clistlen * sizeof(cand)); i = stone(class, slen[0], member, klist); |