4.38 beta

This commit is contained in:
Igor Pavlov
2006-04-13 00:00:00 +00:00
committed by Kornel Lesiński
parent cb9eea7264
commit 83911c8529
54 changed files with 798 additions and 308 deletions

View File

@@ -15,7 +15,7 @@ static CSysString GetLibraryPath()
static CSysString GetLibraryFolderPrefix()
{
CSysString path = GetLibraryPath();
int pos = path.ReverseFind(TEXT('\\'));
int pos = path.ReverseFind(TEXT(CHAR_PATH_SEPARATOR));
return path.Left(pos + 1);
}
@@ -24,11 +24,11 @@ CSysString GetBaseFolderPrefix()
CSysString libPrefix = GetLibraryFolderPrefix();
CSysString temp = libPrefix;
temp.Delete(temp.Length() - 1);
int pos = temp.ReverseFind(TEXT('\\'));
int pos = temp.ReverseFind(TEXT(CHAR_PATH_SEPARATOR));
return temp.Left(pos + 1);
}
CSysString GetCodecsFolderPrefix()
{
return GetBaseFolderPrefix() + TEXT("Codecs\\");
return GetBaseFolderPrefix() + (CSysString)(TEXT("Codecs")) + (CSysString)(TEXT(STRING_PATH_SEPARATOR));
}

View File

@@ -200,7 +200,13 @@ STDMETHODIMP CFilterCoder::Read(void *data, UInt32 size, UInt32 *processedSize)
_convertedPosEnd = Filter->Filter(_buffer, _bufferPos);
if (_convertedPosEnd == 0)
{
break;
if (_bufferPos == 0)
break;
else
{
_convertedPosEnd = _bufferPos; // check it
continue;
}
}
if (_convertedPosEnd > _bufferPos)
{

View File

@@ -7,8 +7,8 @@
namespace NArchive {
namespace NItemName {
static const wchar_t kOSDirDelimiter = '\\';
static const wchar_t kDirDelimiter = '/';
static const wchar_t kOSDirDelimiter = WCHAR_PATH_SEPARATOR;
static const wchar_t kDirDelimiter = L'/';
UString MakeLegalName(const UString &name)
{
@@ -47,4 +47,13 @@ bool HasTailSlash(const AString &name, UINT codePage)
return (*prev == '/');
}
#ifndef _WIN32
UString WinNameToOSName(const UString &name)
{
UString newName = name;
newName.Replace(L'\\', kOSDirDelimiter);
return newName;
}
#endif
}}

View File

@@ -13,6 +13,12 @@ namespace NItemName {
UString GetOSName2(const UString &name);
bool HasTailSlash(const AString &name, UINT codePage);
#ifdef _WIN32
inline UString WinNameToOSName(const UString &name) { return name; }
#else
UString WinNameToOSName(const UString &name);
#endif
}}
#endif