diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2013-04-08 15:38:45 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2013-04-08 15:38:45 +0200 |
commit | 3278fe66567d149ea92c1afa78941f2bc3c71c85 (patch) | |
tree | 3a735d19278bb8f5aa19ba2707f3a09cf52e1d21 /apt-pkg/contrib/netrc.cc | |
parent | 37cc828e003f51d63ed991be5acac36765b8230a (diff) | |
parent | 885594fc8831d1be5a254557385e3dbefb564fbf (diff) |
merged bundle from david
Diffstat (limited to 'apt-pkg/contrib/netrc.cc')
-rw-r--r-- | apt-pkg/contrib/netrc.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 0a902f126..de95aa4ab 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -50,14 +50,10 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw FILE *file; int retcode = 1; int specific_login = (login.empty() == false); - char *home = NULL; bool netrc_alloc = false; - int state_our_login = false; /* With specific_login, - found *our* login name */ - if (!netrcfile) { - home = getenv ("HOME"); /* portable environment reader */ + char const * home = getenv ("HOME"); /* portable environment reader */ if (!home) { struct passwd *pw; @@ -86,6 +82,8 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw int state = NOTHING; char state_login = 0; /* Found a login keyword */ char state_password = 0; /* Found a password keyword */ + int state_our_login = false; /* With specific_login, + found *our* login name */ while (!done && getline(&netrcbuffer, &netrcbuffer_size, file) != -1) { tok = strtok_r (netrcbuffer, " \t\n", &tok_buf); |