X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/69c2ecbdc937e3c73fe67d3c9bce12a80d3ec7ec..d453c9a7ef236b4906b80648ae916a69ae780399:/apt-pkg/contrib/netrc.cc diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index de95aa4ab..8840de72c 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -15,14 +15,13 @@ #include #include -#include -#include #include #include #include #include #include +#include #include #include "netrc.h" @@ -117,7 +116,7 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw state = NOTHING; break; case HOSTVALID: - /* we are now parsing sub-keywords concerning "our" host */ + /* we are now parsing sub-keywords regarding "our" host */ if (state_login) { if (specific_login) state_our_login = !strcasecmp (login.c_str(), tok); @@ -153,18 +152,6 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw return retcode; } -// for some unknown reason this method is exported so keep a compatible interface for now … -int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) -{ - std::string login_string, password_string; - int const ret = parsenetrc_string(host, login_string, password_string, netrcfile); - if (ret < 0) - return ret; - strncpy(login, login_string.c_str(), LOGINSIZE - 1); - strncpy(password, password_string.c_str(), PASSWORDSIZE - 1); - return ret; -} - void maybe_add_auth (URI &Uri, string NetRCFile) { @@ -198,7 +185,7 @@ void maybe_add_auth (URI &Uri, string NetRCFile) // if host did not work, try Host+Path next, this will trigger // a lookup uri.startswith(host) in the netrc file parser (because // of the "/" - char *hostpath = strdup(string(Uri.Host+Uri.Path).c_str()); + char *hostpath = strdup((Uri.Host + Uri.Path).c_str()); if (hostpath && parsenetrc_string(hostpath, login, password, netrcfile) == 0) { if (_config->FindB("Debug::Acquire::netrc", false) == true)