misc/liblua/lauxlib.c
branchwebgl
changeset 9162 2c6ad606f4fb
parent 2812 0a24853de796
child 10015 4feced261c68
equal deleted inserted replaced
9160:fc46e75f6b72 9162:2c6ad606f4fb
   572   }
   572   }
   573   if (c == LUA_SIGNATURE[0] && filename) {  /* binary file? */
   573   if (c == LUA_SIGNATURE[0] && filename) {  /* binary file? */
   574     lf.f = freopen(filename, "rb", lf.f);  /* reopen in binary mode */
   574     lf.f = freopen(filename, "rb", lf.f);  /* reopen in binary mode */
   575     if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
   575     if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
   576     /* skip eventual `#!...' */
   576     /* skip eventual `#!...' */
   577    while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
   577    while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0])
       
   578        /* do nothing */ ;
   578     lf.extraline = 0;
   579     lf.extraline = 0;
   579   }
   580   }
   580   ungetc(c, lf.f);
   581   ungetc(c, lf.f);
   581   status = lua_load(L, getF, &lf, lua_tostring(L, -1));
   582   status = lua_load(L, getF, &lf, lua_tostring(L, -1));
   582   readstatus = ferror(lf.f);
   583   readstatus = ferror(lf.f);