lua-users home
lua-l archive

Re: 5.1 RTL macros

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


David Jones wrote:
> So how do you suggest the two bits of Lua that use ungetc are changed
> so that they don't use ungetc?
in lauxlib.c
typedef struct LoadF {
 int extraline;
+ int firstchar;
 LUA_FILE f;
 char buff[LUAL_BUFFERSIZE];
} LoadF;
in the getF function
+ if (lf->firstchar != (int)-1) {
+ lf->buff[0] = (char)lf->firstchar;
+ lf->firstchar = (int)-1;
+ *size=1;
+ return lf->buff;
+ }

AltStyle によって変換されたページ (->オリジナル) /