]> Pileus Git - ~andy/fetchmail/commitdiff
netrc cleanup.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 14 Jan 2003 12:56:01 +0000 (12:56 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 14 Jan 2003 12:56:01 +0000 (12:56 -0000)
svn path=/trunk/; revision=3779

netrc.c
netrc.h

diff --git a/netrc.c b/netrc.c
index 65ff4d6aa28c3b76ab189e19dd185742c6820821..fd28dc86d1c108cf09986092e6ee1b55a7061867 100644 (file)
--- a/netrc.c
+++ b/netrc.c
@@ -37,8 +37,8 @@ maybe_add_to_list (netrc_entry **newentry, netrc_entry **list)
     a = *newentry;
     l = *list;
 
-    /* We need an account name in order to add the entry to the list. */
-    if (a && ! a->account)
+    /* We need a login name in order to add the entry to the list. */
+    if (a && ! a->login)
     {
        /* Free any allocated space. */
        if (a->host)
@@ -176,7 +176,7 @@ parse_netrc (file)
            {
            case tok_login:
                if (current)
-                   current->account = (char *) xstrdup (tok);
+                   current->login = (char *) xstrdup (tok);
                else
                    premature_token = "login";
                break;
@@ -294,15 +294,15 @@ parse_netrc (file)
 /* Return the netrc entry from LIST corresponding to HOST.  NULL is
    returned if no such entry exists. */
 netrc_entry *
-search_netrc (list, host, account)
+search_netrc (list, host, login)
      netrc_entry *list;
-     char *host, *account;
+     char *host, *login;
 {
     /* Look for the HOST in LIST. */
     while (list)
     {
        if (list->host && !strcmp(list->host, host))
-           if (!list->account || !strcmp(list->account, account))
+           if (!list->login || !strcmp(list->login, login))
                /* We found a matching entry. */
                break;
 
@@ -326,13 +326,13 @@ main (argc, argv)
      char **argv;
 {
     struct stat sb;
-    char *program_name, *file, *host, *account;
+    char *program_name, *file, *host, *login;
     netrc_entry *head, *a;
 
     program_name = argv[0];
     file = argv[1];
     host = argv[2];
-    account = argv[3];
+    login = argv[3];
 
     if (stat (file, &sb))
     {
@@ -348,14 +348,14 @@ main (argc, argv)
        exit (1);
     }
 
-    if (host && account)
+    if (host && login)
     {
        int i, status;
        status = 0;
 
-       printf("Host: %s, Account: %s\n", host, account);
+       printf("Host: %s, Login: %s\n", host, login);
            
-       a = search_netrc (head, host, account);
+       a = search_netrc (head, host, login);
        if (a)
        {
            /* Print out the password (if any). */
@@ -382,8 +382,8 @@ main (argc, argv)
 
        fputc (' ', stdout);
 
-       /* Print the account name. */
-       fputs (a->account, stdout);
+       /* Print the login name. */
+       fputs (a->login, stdout);
 
        if (a->password)
        {
diff --git a/netrc.h b/netrc.h
index 7111146e9456ed432cf20f03f245a84a372d92f0..0309ba6d70d2dec83bc272e03ef3133a6ce665ce 100644 (file)
--- a/netrc.h
+++ b/netrc.h
@@ -27,8 +27,8 @@ typedef struct _netrc_entry {
   /* The exact host name given in the .netrc, NULL if default. */
   char *host;
 
-  /* The name of the account. */
-  char *account;
+  /* The login name of the user. */
+  char *login;
 
   /* Password for the account (NULL, if none). */
   char *password;