Skip to content

Commit

Permalink
Merge remote branch 'remotes/viric-github/master'
Browse files Browse the repository at this point in the history
Conflicts:
	reedsolomon.cpp
  • Loading branch information
alanfalloon committed Nov 9, 2010
2 parents c583420 + 31edecf commit acc828a
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 48 deletions.
Empty file modified INSTALL
100755 → 100644
Empty file.
Empty file modified aclocal.m4
100755 → 100644
Empty file.
26 changes: 12 additions & 14 deletions commandline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,28 +537,26 @@ bool CommandLine::Parse(int argc, char *argv[])
else
{
list<string> *filenames;
filenames = new list<string>;

// If the argument includes wildcard characters,
// search the disk for matching files
if (strchr(argv[0], '*') || strchr(argv[0], '?'))
if (argv[0][0] == '-' && argv[0][1] == '\0')
{
string path;
string name;
DiskFile::SplitFilename(argv[0], path, name);

filenames = DiskFile::FindFiles(path, name);
while(true)
{
string filename;
if (std::getline(cin, filename))
filenames->push_back(filename);
else
break;
}
}
else
{
filenames = new list<string>;
filenames->push_back(argv[0]);
}
filenames->push_back(argv[0]);

list<string>::iterator fn = filenames->begin();
while (fn != filenames->end())
{
// Convert filename from command line into a full path + filename
string filename = DiskFile::GetCanonicalPathname(*fn);
string filename = *fn;

// If this is the first file on the command line, then it
// is the main PAR2 file.
Expand Down
Empty file modified config.h.in
100755 → 100644
Empty file.
11 changes: 3 additions & 8 deletions diskfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ string DiskFile::GetCanonicalPathname(string filename)
string result = work;
delete [] work;

printf("Original: %s\n", filename.c_str());
printf("Canonical: %s\n", result.c_str());

return result;
}

Expand Down Expand Up @@ -866,14 +869,6 @@ string DiskFile::TranslateFilename(string filename)
{
ok = false;
}
else
{
switch (ch)
{
case '/':
ok = false;
}
}
#endif


Expand Down
Empty file modified galois.h
100644 → 100755
Empty file.
Empty file modified par1repairer.cpp
100644 → 100755
Empty file.
4 changes: 1 addition & 3 deletions par2creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,7 @@ bool Par2Creator::OpenSourceFiles(const list<CommandLine::ExtraFile> &extrafiles
{
Par2CreatorSourceFile *sourcefile = new Par2CreatorSourceFile;

string path;
string name;
DiskFile::SplitFilename(extrafile->FileName(), path, name);
string name = extrafile->FileName();

if (noiselevel > CommandLine::nlSilent)
cout << "Opening: " << name << endl;
Expand Down
11 changes: 1 addition & 10 deletions par2creatorsourcefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,7 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma
blockcount = (u32)((filesize + blocksize-1) / blocksize);

// Determine what filename to record in the PAR2 files
string::size_type where;
if (string::npos != (where = diskfilename.find_last_of('\\')) ||
string::npos != (where = diskfilename.find_last_of('/')))
{
parfilename = diskfilename.substr(where+1);
}
else
{
parfilename = diskfilename;
}
parfilename = diskfilename;

// Create the Description and Verification packets
descriptionpacket = new DescriptionPacket;
Expand Down
Empty file modified par2repairer.cpp
100644 → 100755
Empty file.
14 changes: 1 addition & 13 deletions par2repairersourcefile.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,7 @@ void Par2RepairerSourceFile::ComputeTargetFileName(string path)
// Get a version of the filename compatible with the OS
string filename = DiskFile::TranslateFilename(descriptionpacket->FileName());

// Strip the path from the filename
string::size_type where;
if (string::npos != (where = filename.find_last_of('\\'))
|| string::npos != (where = filename.find_last_of('/'))
#ifdef WIN32
|| string::npos != (where = filename.find_last_of(':'))
#endif
)
{
filename = filename.substr(where+1);
}

targetfilename = path + filename;
targetfilename = filename;
}

string Par2RepairerSourceFile::TargetFileName(void) const
Expand Down
Empty file modified par2repairersourcefile.h
100644 → 100755
Empty file.

0 comments on commit acc828a

Please sign in to comment.