diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-25 12:13:33 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-25 12:13:33 +0000 |
| commit | ea49e9c297ade01cad641f468271e7e0444fe2b3 (patch) | |
| tree | c1f6d1a48a9de14fcf35820671ac99857c0061af /src/Netrc.cc | |
| parent | 3a897a4f32c6e40c6c1107a98620e8bcba91c3ec (diff) | |
2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made strings which are only used in comparison plain C strings.
* src/HttpHeader.cc
* src/HttpHeader.h
* src/Netrc.cc
* src/Netrc.h
* test/HttpHeaderTest.cc
Diffstat (limited to 'src/Netrc.cc')
| -rw-r--r-- | src/Netrc.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/Netrc.cc b/src/Netrc.cc index 44acdbe5..507a7f81 100644 --- a/src/Netrc.cc +++ b/src/Netrc.cc @@ -108,18 +108,6 @@ bool DefaultAuthenticator::match(const std::string& hostname) const return true; } -const std::string Netrc::A2_MACHINE("machine"); - -const std::string Netrc::A2_DEFAULT("default"); - -const std::string Netrc::A2_LOGIN("login"); - -const std::string Netrc::A2_PASSWORD("password"); - -const std::string Netrc::A2_ACCOUNT("account"); - -const std::string Netrc::A2_MACDEF("macdef"); - Netrc::Netrc() {} Netrc::~Netrc() {} @@ -169,11 +157,11 @@ void Netrc::parse(const std::string& path) eoi = tokens.end(); iter != eoi; ++iter) { const std::string& token = *iter; if(state == GET_TOKEN) { - if(token == Netrc::A2_MACHINE) { + if(token == "machine") { storeAuthenticator(authenticator); authenticator.reset(new Authenticator()); state = SET_MACHINE; - } else if(token == Netrc::A2_DEFAULT) { + } else if(token == "default") { storeAuthenticator(authenticator); authenticator.reset(new DefaultAuthenticator()); } else { @@ -182,13 +170,13 @@ void Netrc::parse(const std::string& path) (fmt("Netrc:parse error. %s encounterd where 'machine'" " or 'default' expected.", token.c_str())); } - if(token == Netrc::A2_LOGIN) { + if(token == "login") { state = SET_LOGIN; - } else if(token == Netrc::A2_PASSWORD) { + } else if(token == "password") { state = SET_PASSWORD; - } else if(token == Netrc::A2_ACCOUNT) { + } else if(token == "account") { state = SET_ACCOUNT; - } else if(token == Netrc::A2_MACDEF) { + } else if(token == "macdef") { state = SET_MACDEF; } } |
