~ubuntu-branches/ubuntu/vivid/unrar-nonfree/vivid

« back to all changes in this revision

Viewing changes to filestr.cpp

  • Committer: Package Import Robot
  • Author(s): Martin Meredith
  • Date: 2015-02-03 12:58:01 UTC
  • mfrom: (1.1.18) (5.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20150203125801-od6ev8cqy1er51vz
Tags: 1:5.2.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
      wcsncpyz(FileName,Name,ASIZE(FileName));
23
23
 
24
24
  File SrcFile;
25
 
  if (FileName!=NULL && *FileName!=0)
 
25
  if (*FileName!=0)
26
26
  {
27
27
    bool OpenCode=AbortOnError ? SrcFile.WOpen(FileName):SrcFile.Open(FileName,0);
28
28
 
37
37
    SrcFile.SetHandleType(FILE_HANDLESTD);
38
38
 
39
39
  unsigned int DataSize=0,ReadSize;
40
 
  const int ReadBlock=1024;
41
 
  Array<char> Data(ReadBlock+5);
 
40
  const int ReadBlock=4096;
 
41
  Array<char> Data(ReadBlock+3);
42
42
  while ((ReadSize=SrcFile.Read(&Data[DataSize],ReadBlock))!=0)
43
43
  {
44
44
    DataSize+=ReadSize;
45
45
    Data.Add(ReadSize);
46
46
  }
47
47
 
48
 
  memset(&Data[DataSize],0,5);
 
48
  // Add trailing Unicode zero after text data. We add 3 bytes instead of 2
 
49
  // in case read Unicode data contains uneven number of bytes.
 
50
  memset(&Data[DataSize],0,3);
49
51
 
50
52
  Array<wchar> WideStr;
51
53
 
136
138
          break;
137
139
        *SpacePtr=0;
138
140
      }
139
 
      if (*CurStr)
 
141
      if (*CurStr!=0)
140
142
      {
141
143
        if (Unquote && *CurStr=='\"')
142
144
        {