From 4b7ef22ec48616b865bc7cd2eb97ce4e8dc438b6 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 1 Jan 2019 17:04:40 +0100 Subject: [PATCH] Fix wildcard list when built on GTK --- common/wildcards_and_files_ext.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/common/wildcards_and_files_ext.cpp b/common/wildcards_and_files_ext.cpp index f0dcc2f859..5dac72643b 100644 --- a/common/wildcards_and_files_ext.cpp +++ b/common/wildcards_and_files_ext.cpp @@ -71,7 +71,7 @@ static wxString formatWildcardExt( const wxString& aWildcard ) wxString AddFileExtListToFilter( int aArgCnt, ... ) { - wxString files_filter = " (*."; + wxString files_filter = " ("; va_list args; va_start( args, aArgCnt ); @@ -80,18 +80,14 @@ wxString AddFileExtListToFilter( int aArgCnt, ... ) for( int ii = 0; ii < aArgCnt; ii++) { const char* ext = va_arg(args, char*); - - if( ii > 0 ) - files_filter << " *."; - - files_filter << formatWildcardExt( ext ); + files_filter << " *." << ext; } files_filter << ")|*."; va_start( args, aArgCnt ); - // Add extensions to the filter list: + // Add extensions to the filter list, using a formated string (GTK specific): for( int ii = 0; ii < aArgCnt; ii++) { const char* ext = va_arg( args, const char* );