summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/netrc.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-04-23 08:08:54 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-04-23 08:08:54 +0200
commit3444603f5ff2b4c4816e45e686e06e01df31cdc4 (patch)
treeb0e63e9bc86ca6d39f6987381ca7bfa64e186048 /apt-pkg/contrib/netrc.cc
parent52d5690b47bd4efe425fa23d9f6559bb44324cd1 (diff)
parent3278fe66567d149ea92c1afa78941f2bc3c71c85 (diff)
merged debian-sid branch and resolved conflicts
Diffstat (limited to 'apt-pkg/contrib/netrc.cc')
-rw-r--r--apt-pkg/contrib/netrc.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index b3d30fd4a..e61a82f8c 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);