From: Steve K. <ha...@ya...> - 2006-07-15 23:08:56
|
Hi, I found a bug in method GetAllFiles(). The overwrite function pass the wrong parameters positions. static int LUACALL wxLua_wxDir_GetAllFiles(lua_State *L) { wxLuaState wxlState(L); unsigned int returns; // get number of arguments int argCount = lua_gettop(L); // int flags = wxDIR_DEFAULT // Wrong code follow. SHould be 5 not 4 as the first param is luastate // int flags = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxDIR_DEFAULT); int flags = (argCount >= 5 ? (int)wxlState.GetNumberType(5) : wxDIR_DEFAULT); // const wxString& filespec = "" // 3 is wrong, should be 4 wxString filespec = (argCount >= 4 ? lua2wx(wxlState.GetStringType(4)) : wxString(wxT(""))); // wxArrayString *files wxArrayString files; // const wxString& dirname wxString dirname = lua2wx(wxlState.GetStringType(2)); // call GetAllFiles returns = wxDir::GetAllFiles(dirname, &files, filespec, flags); // push the result number lua_pushnumber(L, returns); wxlState.PushwxArrayStringTable(files); // return the number of parameters return 2; } Cheers, S.KIEU --------------------------------- Do you Yahoo!? Yahoo! Personals: It's free to check out our great singles! |