diff --git a/ChangeLog b/ChangeLog index 56714d256..b0a732f1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-15 Tatsuhiro Tsujikawa + + Use A2STR::SHARP_C and A2STR::EQUAL_C. + * src/A2STR.cc + * src/A2STR.h + * src/OptionParser.cc (parse) + 2008-05-15 Tatsuhiro Tsujikawa Defined fake filename `[tracker.announce]' as static const std::string. diff --git a/src/A2STR.cc b/src/A2STR.cc index 334975727..198650467 100644 --- a/src/A2STR.cc +++ b/src/A2STR.cc @@ -52,4 +52,6 @@ const std::string A2STR::DOT_C("."); const std::string A2STR::COLON_C(":"); +const std::string A2STR::EQUAL_C("="); + } // namespace aria2 diff --git a/src/A2STR.h b/src/A2STR.h index d8ea881c5..b4a8fe4ff 100644 --- a/src/A2STR.h +++ b/src/A2STR.h @@ -58,6 +58,8 @@ public: static const std::string DOT_C; static const std::string COLON_C; + + static const std::string EQUAL_C; }; } // namespace aria2 diff --git a/src/OptionParser.cc b/src/OptionParser.cc index 551e69296..7a27b7c30 100644 --- a/src/OptionParser.cc +++ b/src/OptionParser.cc @@ -36,6 +36,7 @@ #include "Util.h" #include "OptionHandlerImpl.h" #include "Option.h" +#include "A2STR.h" #include #include @@ -47,10 +48,10 @@ void OptionParser::parse(Option* option, std::istream& is) int32_t linenum = 0; while(getline(is, line)) { ++linenum; - if(Util::startsWith(line, "#")) { + if(Util::startsWith(line, A2STR::SHARP_C)) { continue; } - std::pair nv = Util::split(line, "="); + std::pair nv = Util::split(line, A2STR::EQUAL_C); OptionHandlerHandle handler = getOptionHandlerByName(nv.first); handler->parse(option, nv.second); }