1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

removed the goto and re-indented slightly

This commit is contained in:
Daniel Stenberg 2003-08-20 15:40:21 +00:00
parent 734e8d6229
commit afc6ade2b9

View File

@ -147,12 +147,16 @@ int Curl_parsenetrc(char *host,
if(file) { if(file) {
char *tok; char *tok;
char *tok_buf; char *tok_buf;
while(fgets(netrcbuffer, sizeof(netrcbuffer), file)) { bool done=FALSE;
tok=strtok_r(netrcbuffer, " \t\n", &tok_buf);
while(tok) {
if (login[0] && password[0]) while(!done && fgets(netrcbuffer, sizeof(netrcbuffer), file)) {
goto done; tok=strtok_r(netrcbuffer, " \t\n", &tok_buf);
while(!done && tok) {
if (login[0] && password[0]) {
done=TRUE;
break;
}
switch(state) { switch(state) {
case NOTHING: case NOTHING:
@ -182,7 +186,8 @@ int Curl_parsenetrc(char *host,
if(state_login) { if(state_login) {
if (specific_login) { if (specific_login) {
state_our_login = strequal(login, tok); state_our_login = strequal(login, tok);
}else{ }
else {
strncpy(login, tok, LOGINSIZE-1); strncpy(login, tok, LOGINSIZE-1);
#ifdef _NETRC_DEBUG #ifdef _NETRC_DEBUG
printf("LOGIN: %s\n", login); printf("LOGIN: %s\n", login);
@ -215,7 +220,6 @@ int Curl_parsenetrc(char *host,
} /* while (tok) */ } /* while (tok) */
} /* while fgets() */ } /* while fgets() */
done:
fclose(file); fclose(file);
} }