Skip to content

Commit

Permalink
win32 bugfix: hidden extensions does not remove dropdown types
Browse files Browse the repository at this point in the history
thanks Azael from garagegames for the fix suggestion
  • Loading branch information
mlabbe committed Dec 31, 2018
1 parent 4f9f624 commit ad50d4f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/nfd_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const char
if ( *p_filterList == ';' || *p_filterList == '\0' )
{
/* end of filter -- add it to specList */

// Empty filter name -- Windows describes them by extension.
specList[specIdx].pszName = EMPTY_WSTR;

CopyNFDCharToWChar( specbuf, (wchar_t**)&specList[specIdx].pszName );
CopyNFDCharToWChar( specbuf, (wchar_t**)&specList[specIdx].pszSpec );

memset( specbuf, 0, sizeof(char)*NFD_MAX_STRLEN );
Expand All @@ -207,7 +206,7 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const char

/* Add wildcard */
specList[specIdx].pszSpec = WILDCARD;
specList[specIdx].pszName = EMPTY_WSTR;
specList[specIdx].pszName = WILDCARD;

fileOpenDialog->SetFileTypes( filterCount+1, specList );

Expand Down

0 comments on commit ad50d4f

Please sign in to comment.