After looking at it more, I see that

1. the case of 0 length lines can't be a terminating condition for the loop 
since the byLine() call removes the newline character and returns 0 length 
lines for a line that has only a newline.

2. the initial test of empty(), which tests based on the file being not open, 
is used as the loop terminating condition.  It doesn't catch the case of the 
first line of input being ctrl-z because it is executed before the calls to 
front() and popFront().  popFront() is what does the file.detach.

 

Reply via email to