]> sjero.net Git - wget/blobdiff - src/ftp.c
[svn] Treat the "shortcut icon" link as inline.
[wget] / src / ftp.c
index c1c46ec9f773459dea16db5404e92b926a56efa7..1b78fd333f9bfe7159599de469e1e2c6bf31b90e 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -33,9 +33,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/types.h>
 #include <assert.h>
 #include <errno.h>
-#ifndef WINDOWS
-# include <netdb.h>            /* for h_errno */
-#endif
 
 #include "wget.h"
 #include "utils.h"
@@ -51,11 +48,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #ifndef errno
 extern int errno;
 #endif
-#ifndef h_errno
-# ifndef __CYGWIN__
-extern int h_errno;
-# endif
-#endif
 
 /* File where the "ls -al" listing will be saved.  */
 #define LIST_FILENAME ".listing"
@@ -264,7 +256,7 @@ Error in server response, closing control connection.\n"));
          abort ();
          break;
        }
-      if (!opt.server_response)
+      if (!opt.server_response && err != FTPSRVERR)
        logputs (LOG_VERBOSE, _("done.    "));
 
       /* Fourth: Find the initial ftp directory */
@@ -276,7 +268,6 @@ Error in server response, closing control connection.\n"));
       switch (err)
        {
        case FTPRERR:
-       case FTPSRVERR :
          logputs (LOG_VERBOSE, "\n");
          logputs (LOG_NOTQUIET, _("\
 Error in server response, closing control connection.\n"));
@@ -284,6 +275,11 @@ Error in server response, closing control connection.\n"));
          rbuf_uninitialize (&con->rbuf);
          return err;
          break;
+       case FTPSRVERR :
+         /* PWD unsupported -- assume "/". */
+         FREE_MAYBE (con->id);
+         con->id = xstrdup ("/");
+         break;
        case FTPOK:
          /* Everything is OK.  */
          break;
@@ -597,15 +593,6 @@ Error in server response, closing control connection.\n"));
              closeport (dtsock);
              return err;
              break;
-           case HOSTERR:
-             logputs (LOG_VERBOSE, "\n");
-             logprintf (LOG_NOTQUIET, "%s: %s\n", u->host,
-                        herrmsg (h_errno));
-             CLOSE (csock);
-             closeport (dtsock);
-             rbuf_uninitialize (&con->rbuf);
-             return HOSTERR;
-             break;
            case FTPPORTERR:
              logputs (LOG_VERBOSE, "\n");
              logputs (LOG_NOTQUIET, _("Invalid PORT.\n"));