Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: chrome/tools/pbl_tool/pbl_tool.cc

Issue 159199: Load Multiple Blacklists... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/blacklist_samples/session_cookies.pbl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/pbl_tool/pbl_tool.cc
===================================================================
--- chrome/tools/pbl_tool/pbl_tool.cc (revision 21552)
+++ chrome/tools/pbl_tool/pbl_tool.cc (working copy)
@@ -24,8 +24,8 @@
namespace {
int PrintUsage(int argc, ICHAR* argv[]) {
- ICERR << "Usage: " << argv[0] << " <source> <target>\n"
- " <source> is the text blacklist (.pbl) to load.\n"
+ ICERR << "Usage: " << argv[0] << " <source>... <target>\n"
+ " <source> are text blacklists (.pbl) to load.\n"
" <target> is the binary output blacklist repository.\n\n"
"Adds all entries from <source> to <target>.\n"
"Creates <target> if it does not exist.\n";
@@ -40,18 +40,18 @@
if (argc < 3)
return PrintUsage(argc, argv);
- FilePath input(argv[1]);
- FilePath output(argv[2]);
-
BlacklistIO io;
- if (io.Read(input)) {
- if (io.Write(output)) {
- return 0;
- } else {
- ICERR << "Error writing output file " << argv[2] << "\n";
+ for (int current = 1; current < argc-1; ++current) {
+ FilePath input(argv[current]);
+ if (!io.Read(input)) {
+ ICERR << "Error reading input file " << argv[current] << "\n";
+ return -1;
}
- } else {
- ICERR << "Error reading input file " << argv[1] << "\n";
}
- return -1;
+
+ FilePath output(argv[argc-1]);
+ if (!io.Write(output))
+ ICERR << "Error writing output file " << argv[2] << "\n";
+
+ return 0;
}
« no previous file with comments | « chrome/test/data/blacklist_samples/session_cookies.pbl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698