/* Attempts to read one line from the file. The actual data read is pushed on the stack (or nil on EOF).  */
static int File_read_line(lua_State *L, FILE_T ft)
/* Attempts to read one line from the file. The actual data read is pushed on the stack (or nil on EOF).  */
static int File_read_line(lua_State *L, FILE_T ft)
{
        lua_pushnil(L);
        return 0;
    }
    length = (gint)(file_tell(ft) - pos_before);
    if (linebuff[length-1] == '\n') {
        length--;
        if (length > 0 && linebuff[length - 1] == '\r') {
            length--;
        }
        linebuff[length] = '\0';
    }
    lua_pushlstring(L, linebuff, length);
    return 1;
}