diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-01-05 16:01:46 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-01-05 16:01:46 +0000 |
| commit | 4db349c1f32b4a313d12d114137432441633d00a (patch) | |
| tree | 417451971e264834312cfd8339c79930d680a5d1 /src/Netrc.cc | |
| parent | 338e8aca09331d3e7fa4e1e8e1f9d10260986772 (diff) | |
2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Untabify. Fixed one line in copyright which is longer than 80
columns.
* src
* test
Diffstat (limited to 'src/Netrc.cc')
| -rw-r--r-- | src/Netrc.cc | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/Netrc.cc b/src/Netrc.cc index cb60e977..253c2e5f 100644 --- a/src/Netrc.cc +++ b/src/Netrc.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the @@ -95,46 +95,46 @@ void Netrc::parse(const std::string& path) std::vector<std::string> tokens; util::split(line, std::back_inserter(tokens), " \t", true); for(std::vector<std::string>::const_iterator iter = tokens.begin(); - iter != tokens.end(); ++iter) { + iter != tokens.end(); ++iter) { const std::string& token = *iter; if(state == GET_TOKEN) { - if(token == Netrc::MACHINE) { - storeAuthenticator(authenticator); - authenticator.reset(new Authenticator()); - state = SET_MACHINE; - } else if(token == Netrc::DEFAULT) { - storeAuthenticator(authenticator); - authenticator.reset(new DefaultAuthenticator()); - } else { - if(authenticator.isNull()) { - throw DL_ABORT_EX - (StringFormat("Netrc:parse error. %s encounterd where 'machine'" - " or 'default' expected.", token.c_str()).str()); - } - if(token == Netrc::LOGIN) { - state = SET_LOGIN; - } else if(token == Netrc::PASSWORD) { - state = SET_PASSWORD; - } else if(token == Netrc::ACCOUNT) { - state = SET_ACCOUNT; - } else if(token == Netrc::MACDEF) { - state = SET_MACDEF; - } - } + if(token == Netrc::MACHINE) { + storeAuthenticator(authenticator); + authenticator.reset(new Authenticator()); + state = SET_MACHINE; + } else if(token == Netrc::DEFAULT) { + storeAuthenticator(authenticator); + authenticator.reset(new DefaultAuthenticator()); + } else { + if(authenticator.isNull()) { + throw DL_ABORT_EX + (StringFormat("Netrc:parse error. %s encounterd where 'machine'" + " or 'default' expected.", token.c_str()).str()); + } + if(token == Netrc::LOGIN) { + state = SET_LOGIN; + } else if(token == Netrc::PASSWORD) { + state = SET_PASSWORD; + } else if(token == Netrc::ACCOUNT) { + state = SET_ACCOUNT; + } else if(token == Netrc::MACDEF) { + state = SET_MACDEF; + } + } } else { - if(state == SET_MACHINE) { - authenticator->setMachine(token); - } else if(state == SET_LOGIN) { - authenticator->setLogin(token); - } else if(state == SET_PASSWORD) { - authenticator->setPassword(token); - } else if(state == SET_ACCOUNT) { - authenticator->setAccount(token); - } else if(state == SET_MACDEF) { - skipMacdef(f); - } - state = GET_TOKEN; - } + if(state == SET_MACHINE) { + authenticator->setMachine(token); + } else if(state == SET_LOGIN) { + authenticator->setLogin(token); + } else if(state == SET_PASSWORD) { + authenticator->setPassword(token); + } else if(state == SET_ACCOUNT) { + authenticator->setAccount(token); + } else if(state == SET_MACDEF) { + skipMacdef(f); + } + state = GET_TOKEN; + } } } if(state != GET_TOKEN) { @@ -167,7 +167,7 @@ AuthenticatorHandle Netrc::findAuthenticator(const std::string& hostname) const { Authenticators::const_iterator itr = std::find_if(authenticators.begin(), authenticators.end(), - AuthHostMatch(hostname)); + AuthHostMatch(hostname)); if(itr == authenticators.end()) { return SharedHandle<Authenticator>(); } else { |
