diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-03-19 09:16:53 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-03-19 09:16:53 +0000 |
| commit | e0335dcd4f198d1258fccda5b7d43b2074f15086 (patch) | |
| tree | 745b4791154ddcdd0a7e19d50d06e28acf1a0678 /src/UriListParser.cc | |
| parent | 49511423468b4fcaeb7bcf2ee3800ab55ce94848 (diff) | |
2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Lines starting "#" in -i list are treated as comments.
Example:
# this is comment
http://example.org/file
http://example.org/file2
dir=/tmp
# another comment
out=myfile
* doc/aria2c.1.txt
* src/UriListParser.cc
* test/filelist1.txt
Diffstat (limited to 'src/UriListParser.cc')
| -rw-r--r-- | src/UriListParser.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/UriListParser.cc b/src/UriListParser.cc index 51618e0e..2ac5b96e 100644 --- a/src/UriListParser.cc +++ b/src/UriListParser.cc @@ -41,6 +41,7 @@ #include "Option.h" #include "OptionHandlerFactory.h" #include "OptionHandler.h" +#include "A2STR.h" namespace aria2 { @@ -57,6 +58,8 @@ void UriListParser::getOptions(Option& op) while(getline(_in, _line)) { if(util::startsWith(_line, " ")) { ss << _line << "\n"; + } else if(util::startsWith(_line, A2STR::SHARP_C)) { + continue; } else { break; } @@ -73,7 +76,7 @@ void UriListParser::parseNext(std::vector<std::string>& uris, Option& op) return; } do { - if(!util::trim(_line).empty()) { + if(!util::startsWith(_line, A2STR::SHARP_C) && !util::trim(_line).empty()) { util::split(_line, std::back_inserter(uris), "\t", true); getOptions(op); return; |
