~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to lib/netrc.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-02-08 11:20:41 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20080208112041-hed7sb5r6ghmjf8v
Tags: upstream-7.18.0
ImportĀ upstreamĀ versionĀ 7.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: netrc.c,v 1.37 2007-04-25 03:00:10 yangtse Exp $
 
21
 * $Id: netrc.c,v 1.38 2007-11-07 09:21:35 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
99
99
 
100
100
    char *override = curl_getenv("CURL_DEBUG_NETRC");
101
101
 
102
 
    if (override) {
 
102
    if(override) {
103
103
      fprintf(stderr, "NETRC: overridden " NETRC " file: %s\n", override);
104
104
      netrcfile = override;
105
105
      netrc_alloc = TRUE;
115
115
    else {
116
116
      struct passwd *pw;
117
117
      pw= getpwuid(geteuid());
118
 
      if (pw) {
 
118
      if(pw) {
119
119
#ifdef  VMS
120
120
        home = decc$translate_vms(pw->pw_dir);
121
121
#else
148
148
      tok=strtok_r(netrcbuffer, " \t\n", &tok_buf);
149
149
      while(!done && tok) {
150
150
 
151
 
        if (login[0] && password[0]) {
 
151
        if(login[0] && password[0]) {
152
152
          done=TRUE;
153
153
          break;
154
154
        }
179
179
        case HOSTVALID:
180
180
          /* we are now parsing sub-keywords concerning "our" host */
181
181
          if(state_login) {
182
 
            if (specific_login) {
 
182
            if(specific_login) {
183
183
              state_our_login = strequal(login, tok);
184
184
            }
185
185
            else {
191
191
            state_login=0;
192
192
          }
193
193
          else if(state_password) {
194
 
            if (state_our_login || !specific_login) {
 
194
            if(state_our_login || !specific_login) {
195
195
              strncpy(password, tok, PASSWORDSIZE-1);
196
196
#ifdef _NETRC_DEBUG
197
197
              fprintf(stderr, "PASSWORD: %s\n", password);
212
212
        } /* switch (state) */
213
213
 
214
214
        tok = strtok_r(NULL, " \t\n", &tok_buf);
215
 
      } /* while (tok) */
 
215
      } /* while(tok) */
216
216
    } /* while fgets() */
217
217
 
218
218
    fclose(file);