X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd6c844b172c174c149a72c8c13363250d990e7a..b8c631bb299230a18a9d2bbb26d28a426c161a8f:/src/msw/registry.cpp?ds=sidebyside diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index b2650bcb6b..a2f1b268e9 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -887,11 +887,14 @@ bool GetFileTypeIcon(wxIcon *pIcon, const wxString& strFileType) // NB: icon index may be negative as well as positive and the full path // may contain the environment variables inside '%' wxString strFullPath = strIcon.Before(','), - strIndex = strIcon.After(','); + strIndex = strIcon.Right(','); - // unless I misunderstand the format (may be index may be ommited, I - // don't know) - wxASSERT( !(strFullPath.IsEmpty() || strIndex.IsEmpty()) ); + // index may be omitted, in which case Before(',') is empty and + // Right(',') is the whole string + if ( strFullPath.IsEmpty() ) { + strFullPath = strIndex; + strIndex = "0"; + } wxString strExpPath = wxExpandEnvVars(strFullPath); int nIndex = atoi(strIndex);