X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7482b22003c03f7aa3335aec271b5fcb48e2693d..cce4b3fe2b05e1d928d7a5930c33c624b2f3a667:/src/msw/filedlg.cpp diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index b302e60220..c596792816 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -106,8 +106,8 @@ wxString wxFileSelector(const char *title, if( i-is-1 > 0 && is+1 < filter2.Len() ) { -// if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) ) - if( filter2.Mid(is+1,i-is-1) == defaultExtension ) + if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) ) +// if( filter2.Mid(is+1,i-is-1) == defaultExtension ) { filterFind = filterIndex; break; @@ -251,10 +251,13 @@ int wxFileDialog::ShowModal(void) else { // more then one filter filterBuffer = theFilter; - for ( unsigned int i = 0; i < filterBuffer.Len(); i++ ) { - if ( filterBuffer.GetChar(i) == '|' ) { - filterBuffer[i] = '\0'; - } + } + + filterBuffer += "|"; + // Replace | with \0 + for ( unsigned int i = 0; i < filterBuffer.Len(); i++ ) { + if ( filterBuffer.GetChar(i) == '|' ) { + filterBuffer[i] = '\0'; } }