lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Sep 27, 2010 at 08:45:01PM +1000, Quae Quack wrote:
> On 27 September 2010 20:22, Rob Kendrick <rjek@rjek.com> wrote:
> > On Mon, Sep 27, 2010 at 08:00:32PM +1000, Quae Quack wrote:
> >
> >> why not use ungetc?
> >
> > Because Lua is written in C, and C's ungetc is not guarenteed to work
> > for more tha one byte.
> 
> Not guaranteed to work, but you can try, checking for EOF.

And then what?  Do precisely what the OP does. :)  Alternatively, I'd
suggest not advocating the support of broken files generated by broken
tools.  Fix the tools, not the language.

B.