diff --git a/dsl.cc b/dsl.cc index 93b6570b..4de6521d 100644 --- a/dsl.cc +++ b/dsl.cc @@ -70,7 +70,7 @@ DEF_EX_STR( exCantReadFile, "Can't read file", Dictionary::Ex ) enum { Signature = 0x584c5344, // DSLX on little-endian, XLSD on big-endian - CurrentFormatVersion = 16 + BtreeIndexing::FormatVersion + Folding::Version, + CurrentFormatVersion = 17 + BtreeIndexing::FormatVersion + Folding::Version, CurrentZipSupportVersion = 2 }; diff --git a/dsl_details.cc b/dsl_details.cc index 8da4009a..0c2289bd 100644 --- a/dsl_details.cc +++ b/dsl_details.cc @@ -1049,8 +1049,18 @@ void expandTildes( wstring & str, wstring const & tildeReplacement ) else if ( str[ x ] == L'~' ) { - str.replace( x, 1, tildeReplacement ); - x += tildeReplacement.size(); + if( x > 0 && str[ x - 1 ] == '^' && ( x < 2 || str[ x - 2 ] != '\\' ) ) + { + str.replace( x - 1, 2, tildeReplacement ); + str[ x - 1 ] = QChar( str[ x - 1 ] ).isUpper() ? QChar::toLower( str[ x - 1 ] ) + : QChar::toUpper( str[ x - 1 ] ); + x = x - 1 + tildeReplacement.size(); + } + else + { + str.replace( x, 1, tildeReplacement ); + x += tildeReplacement.size(); + } } else ++x;