diff options
| author | Alexander Lantsev <aunsane@gmail.com> | 2016-06-13 15:10:30 +0000 | 
|---|---|---|
| committer | Alexander Lantsev <aunsane@gmail.com> | 2016-06-13 15:10:30 +0000 | 
| commit | bfef141fa44aace5d845bfa0d06e4435c97984ba (patch) | |
| tree | 1d875816cdfb7f1b068edb757cf84c4dc1b4e22d /plugins/MirLua/Modules/WinAPI/src | |
| parent | 12079f831a61d7016719884102355c93d461abe3 (diff) | |
some fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@16967 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/Modules/WinAPI/src')
| -rw-r--r-- | plugins/MirLua/Modules/WinAPI/src/winapi.cpp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp index bb1606ba35..7aef66d263 100644 --- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp +++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp @@ -1706,21 +1706,22 @@ static int global_GetCurrentProcessId(lua_State *L)  static int global_GetOpenFileName(lua_State *L)
  {
 -	const char *szExt = luaL_optstring(L, 1, nullptr);
 -	_A2T tszExt(szExt);
 -	wchar_t buff[MAX_PATH], f[2] = { 0, 0 };
 +	_A2T tszExt(lua_tostring(L, 1));
 +
 +	TCHAR buff[MAX_PATH] = _T("");
  	OPENFILENAME ofn = { 0 };
  	ofn.lStructSize = sizeof(ofn);
  	ofn.lpstrFile = buff;
  	ofn.nMaxFile = _countof(buff);
  	ofn.lpstrDefExt = tszExt;
 -	ofn.lpstrFilter = f;
 +	ofn.lpstrFilter = _T("\0\0");
 -	if (GetOpenFileNameW(&ofn))
 +	if (GetOpenFileName(&ofn))
  		lua_pushstring(L, T2Utf(buff));
  	else
  		lua_pushnil(L);
 +
  	return 1;
  }
  | 
