On 18-May-2002 Matt Wilson wrote:
> BB CVS is broken!!! It crashes on startup, and I've had to revert to 0.62.1
> O_o
> 
> Matt.

oh well, I tried replacing one of Brad's while loops[1] with a for loop and
forgot about why I left the while loop in the first place.

while (1) {
  it = find(tmp, end, ',')
  addWorkspaceName(string(tmp, it))
  if (it == end) break;
  ++it;
}

just screams to be a for loop does it not?  However the catch is the order of
the last two calls.  It checks the value THEN increments.  So what was
happening was we read the last workspace name and it pointed to the end of the
string and the the for loop incremented it so it was now end + 1 and undefined.
 Ooops.  Hence the crash, the loop condition was never met.  I reverted the
change and actually tested the code this time.

I am usually better about seeing the binary work before I hit commit but I
thought I had not changed anything drastic enough to matter.

[1] seems one of Brad's coworkers believes that a for() loop has no place in C
and a while loop should always be used.  I obviously disagree (-:

Reply via email to