PKGBUILDs/aur/par2cmdline/02-Report-empty-files-when-verifying.patch
2011-06-09 17:56:14 -04:00

51 lines
1.3 KiB
Diff

--- a/par1repairer.cpp
+++ b/par1repairer.cpp
@@ -710,7 +710,13 @@ bool Par1Repairer::VerifyDataFile(DiskFile *diskfile, Par1RepairerSourceFile *so
u64 filesize = diskfile->FileSize();
if (filesize == 0)
+ {
+ if (noiselevel > CommandLine::nlSilent)
+ {
+ cout << "Target: \"" << name << "\" - empty." << endl;
+ }
return true;
+ }
// Search for the first file that is the correct size
vector<Par1RepairerSourceFile*>::iterator sourceiterator = sourcefiles.begin();
--- a/par2repairer.cpp
+++ b/par2repairer.cpp
@@ -1415,17 +1415,28 @@ bool Par2Repairer::ScanDataFile(DiskFile *diskfile, // [in]
matchtype = eNoMatch;
+ string path;
+ string name;
+ DiskFile::SplitFilename(diskfile->FileName(), path, name);
+
// Is the file empty
if (diskfile->FileSize() == 0)
{
// If the file is empty, then just return
+ if (noiselevel > CommandLine::nlSilent)
+ {
+ if (originalsourcefile != 0)
+ {
+ cout << "Target: \"" << name << "\" - empty." << endl;
+ }
+ else
+ {
+ cout << "File: \"" << name << "\" - empty." << endl;
+ }
+ }
return true;
}
- string path;
- string name;
- DiskFile::SplitFilename(diskfile->FileName(), path, name);
-
string shortname;
if (name.size() > 56)
{