summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/netrc.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2011-08-15 14:10:42 +0200
committerMichael Vogt <egon@debian-devbox>2011-08-15 14:10:42 +0200
commitc5ca2c52a98fcb50de6429cf370ed5b6b7602a00 (patch)
tree03dbb2f6898ad12126c40e6f7c64c01e863ccacd /apt-pkg/contrib/netrc.cc
parent97efc27f0723f09405d7a1836ab21c2e2948eb10 (diff)
parentd4882aa1e1a37b3092950180036676a930a5792f (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg/contrib/netrc.cc')
-rw-r--r--apt-pkg/contrib/netrc.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index 34f472ee1..9ff5796c5 100644
--- a/apt-pkg/contrib/netrc.cc
+++ b/apt-pkg/contrib/netrc.cc
@@ -47,10 +47,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
int specific_login = (login[0] != 0);
char *home = NULL;
bool netrc_alloc = false;
- 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 */
@@ -81,6 +78,10 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
bool done = false;
char netrcbuffer[256];
+ int state = NOTHING;
+ char state_login = 0; /* Found a login keyword */
+ char state_password = 0; /* Found a password keyword */
+
while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) {
tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
while (!done && tok) {