lua-users home
lua-l archive

[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;
+  }