updated on Thu Jan 12 16:09:17 UTC 2012
[aur-mirror.git] / par2cmdline / 02-Report-empty-files-when-verifying.patch
blob3e751c09da9924487b744846a52941e50019c9ff
1 --- a/par1repairer.cpp
2 +++ b/par1repairer.cpp
3 @@ -710,7 +710,13 @@ bool Par1Repairer::VerifyDataFile(DiskFile *diskfile, Par1RepairerSourceFile *so
4 u64 filesize = diskfile->FileSize();
6 if (filesize == 0)
7 + {
8 + if (noiselevel > CommandLine::nlSilent)
9 + {
10 + cout << "Target: \"" << name << "\" - empty." << endl;
11 + }
12 return true;
13 + }
15 // Search for the first file that is the correct size
16 vector<Par1RepairerSourceFile*>::iterator sourceiterator = sourcefiles.begin();
17 --- a/par2repairer.cpp
18 +++ b/par2repairer.cpp
19 @@ -1415,17 +1415,28 @@ bool Par2Repairer::ScanDataFile(DiskFile *diskfile, // [in]
21 matchtype = eNoMatch;
23 + string path;
24 + string name;
25 + DiskFile::SplitFilename(diskfile->FileName(), path, name);
27 // Is the file empty
28 if (diskfile->FileSize() == 0)
30 // If the file is empty, then just return
31 + if (noiselevel > CommandLine::nlSilent)
32 + {
33 + if (originalsourcefile != 0)
34 + {
35 + cout << "Target: \"" << name << "\" - empty." << endl;
36 + }
37 + else
38 + {
39 + cout << "File: \"" << name << "\" - empty." << endl;
40 + }
41 + }
42 return true;
45 - string path;
46 - string name;
47 - DiskFile::SplitFilename(diskfile->FileName(), path, name);
49 string shortname;
50 if (name.size() > 56)