[Rd] (HP-UX) scan: last line gets duplicated (PR#790)

Prof Brian Ripley ripley@stats.ox.ac.uk
Mon, 25 Dec 2000 18:01:24 +0000 (GMT)

On Sat, 23 Dec 2000, Peter Kleiweg wrote:

> Peter Kleiweg skriver...
> [about possible compiler error]
> > Usually, bugs aren't. Usually, it's that one compiler just
> > happens to produce code and data that won't generate an
> > exceptional situation you just hadn't thought of, and you
> > won't notice the error until you use another compiler.
> > 
> > Which seems to be the case here.
> [snip faulty patch, see other mail for correct fix]
> > You can see what the problem was. The faulty code doesn't
> > prevent to test whether the characters *before* the start of
> > the buffer are white space, which can be anything.
> I've been thinking about this. The original code was apparently
> based on the assumption that (at that point in the program) the
> buffer could never be empty (apart from white space). Maybe the
> assumption is correct, and this bug actually is an expression of
> an error somewhere else. An error with handling EOF, or
> something, or even a compiler error.
> Should this be checked?

Could you send us your example file for this problem?  I think the
assumption is that a field will never be empty apart from white space.
in which case there is a simpler patch, as fields only of white space
don't put anything in the buffer.

Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch