PKGBUILDs/aur/par2cmdline/08-Allowing-commandline-passing-of-files.patch
2011-06-09 17:56:14 -04:00

34 lines
1,012 B
Diff

--- a/commandline.cpp
+++ b/commandline.cpp
@@ -537,21 +537,18 @@ 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] == '-')
{
- string path;
- string name;
- DiskFile::SplitFilename(argv[0], path, name);
-
- filenames = DiskFile::FindFiles(path, name);
- }
- else
- {
- filenames = new list<string>;
- filenames->push_back(argv[0]);
+ while(true)
+ {
+ string filename;
+ if (std::getline(cin, filename))
+ filenames->push_back(filename);
+ else
+ break;
+ }
}
list<string>::iterator fn = filenames->begin();