updated on Thu Jan 12 16:09:17 UTC 2012
[aur-mirror.git] / par2cmdline / 08-Allowing-commandline-passing-of-files.patch
blob6d0a0249bc98503e45fa3c7cf88e0d9a87590529
1 --- a/commandline.cpp
2 +++ b/commandline.cpp
3 @@ -537,21 +537,18 @@ bool CommandLine::Parse(int argc, char *argv[])
4 else
6 list<string> *filenames;
7 + filenames = new list<string>;
9 - // If the argument includes wildcard characters,
10 - // search the disk for matching files
11 - if (strchr(argv[0], '*') || strchr(argv[0], '?'))
12 + if (argv[0][0] == '-')
14 - string path;
15 - string name;
16 - DiskFile::SplitFilename(argv[0], path, name);
18 - filenames = DiskFile::FindFiles(path, name);
19 - }
20 - else
21 - {
22 - filenames = new list<string>;
23 - filenames->push_back(argv[0]);
24 + while(true)
25 + {
26 + string filename;
27 + if (std::getline(cin, filename))
28 + filenames->push_back(filename);
29 + else
30 + break;
31 + }
34 list<string>::iterator fn = filenames->begin();