This commit is contained in:
Igor Pavlov
2014-12-26 00:00:00 +00:00
committed by Kornel Lesiński
parent 0dc16c691d
commit 7e021179cd
9 changed files with 79 additions and 25 deletions

View File

@@ -9,9 +9,9 @@ STDMETHODIMP CSequentialInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *p
UInt32 realProcessed = 0;
HRESULT result = S_OK;
if (_stream)
_stream->Read(data, size, &realProcessed);
result = _stream->Read(data, size, &realProcessed);
_size += realProcessed;
if (size > 0 && realProcessed == 0)
if (size != 0 && realProcessed == 0)
_wasFinished = true;
_crc = CrcUpdate(_crc, data, realProcessed);
if (processedSize)
@@ -27,7 +27,7 @@ STDMETHODIMP CInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSi
result = _stream->Read(data, size, &realProcessed);
_size += realProcessed;
/*
if (size > 0 && realProcessed == 0)
if (size != 0 && realProcessed == 0)
_wasFinished = true;
*/
_crc = CrcUpdate(_crc, data, realProcessed);

View File

@@ -337,7 +337,7 @@ HRESULT CHandler::Open2(IInStream *stream, IArchiveOpenCallback *callback)
break;
if (items.Size() >= kNumChunksMax)
return S_FALSE;
Byte firstByte = buf[kTagHeaderSize];
Byte firstByte = item.Data[kTagHeaderSize];
Byte subType, props;
if (item.Type == kType_Audio)
{

View File

@@ -964,22 +964,21 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
case kpidUnpackVer: prop = item.UnPackVersion; break;
case kpidMethod:
{
char temp[16];
char *s = temp;
if (item.Method >= (Byte)'0' && item.Method <= (Byte)'5')
char s[16];
Byte m = item.Method;
if (m < (Byte)'0' || m > (Byte)'5')
ConvertUInt32ToString(m, s);
else
{
*s++ = 'm';
*s++ = (char)item.Method;
s[0] = 'm';
s[1] = (char)m;
s[2] = 0;
if (!item.IsDir())
{
*s++ = ':';
ConvertUInt32ToString(16 + item.GetDictSize(), s);
s[2] = ':';
ConvertUInt32ToString(16 + item.GetDictSize(), &s[3]);
}
}
else
ConvertUInt32ToString(item.Method, s);
s += MyStringLen(s);
*s = 0;
prop = s;
break;
}

View File

@@ -1216,10 +1216,10 @@ HRESULT UpdateArchive(
createTempFile = true;
ap.Temp = true;
if (!options.WorkingDir.IsEmpty())
{
ap.TempPrefix = options.WorkingDir;
NormalizeDirPathPrefix(ap.TempPrefix);
}
else
ap.TempPrefix = us2fs(ap.Prefix);
NormalizeDirPathPrefix(ap.TempPrefix);
}
}