]> sjero.net Git - wget/blobdiff - src/netrc.c
[svn] Allow Wget to be compiled with a K&R compiler.
[wget] / src / netrc.c
index 8a048fd9129f81a2f9de09f19ac35273fbe99d58..9535472c469dabdafe373ad946e27c615fa11b20 100644 (file)
@@ -1,20 +1,20 @@
 /* Read and parse the .netrc file to get hosts, accounts, and passwords.
    Copyright (C) 1996, Free Software Foundation, Inc.
 
-This file is part of Wget.
+This file is part of GNU Wget.
 
-This program is free software; you can redistribute it and/or modify
+GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
+GNU Wget is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
+along with Wget; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* This file used to be kept in synch with the code in Fetchmail, but
@@ -90,8 +90,6 @@ search_netrc (const char *host, const char **acc, const char **passwd,
   /* Acc and password found; all OK.  */
   if (*acc && *passwd)
     return;
-  if (!*acc && !slack_default)
-    return;
   /* Some data not given -- try finding the host.  */
   for (l = netrc_list; l; l = l->next)
     {
@@ -237,7 +235,8 @@ maybe_add_to_list (acc_t **newentry, acc_t **list)
    null-terminated string once character to the left.
    Used in processing \ and " constructs in the netrc file */
 static void
-shift_left(char *string){
+shift_left(char *string)
+{
   char *p;
   
   for (p=string; *p; ++p)
@@ -282,6 +281,10 @@ parse_netrc (const char *path)
       p = line;
       quote = 0;
 
+      /* Skip leading whitespace.  */
+      while (*p && ISSPACE (*p))
+       p ++;
+
       /* If the line is empty, then end any macro definition.  */
       if (last_token == tok_macdef && !*p)
        /* End of macro if the line is empty.  */