[svn] When PWD fails, assume "/".

Published in <sxs667qr5a0.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2001-12-01 13:37:40 -08:00
parent 8b2a216c77
commit acf2d79a8a
3 changed files with 20 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2001-12-01 Hrvoje Niksic <hniksic@arsdigita.com>
* ftp.c (getftp): When PWD fails, assume "/".
* ftp-basic.c (ftp_syst): Fix indentation.
2001-12-01 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (get_urls_file): If opt.base_href is specified, merge each

View File

@ -550,6 +550,7 @@ ftp_syst (struct rbuf *rbuf, enum stype *server_type)
return WRITEFAILED;
}
xfree (request);
/* Get appropriate response. */
err = ftp_response (rbuf, &respline);
if (err != FTPOK)
@ -572,17 +573,14 @@ ftp_syst (struct rbuf *rbuf, enum stype *server_type)
if (!strcasecmp (request, "VMS"))
*server_type = ST_VMS;
else if (!strcasecmp (request, "UNIX"))
*server_type = ST_UNIX;
else if (!strcasecmp (request, "WINDOWS_NT"))
*server_type = ST_WINNT;
else if (!strcasecmp (request, "MACOS"))
*server_type = ST_MACOS;
else
if (!strcasecmp (request, "UNIX"))
*server_type = ST_UNIX;
else
if (!strcasecmp (request, "WINDOWS_NT"))
*server_type = ST_WINNT;
else
if (!strcasecmp (request, "MACOS"))
*server_type = ST_MACOS;
else
*server_type = ST_OTHER;
*server_type = ST_OTHER;
xfree (respline);
/* All OK. */

View File

@ -264,7 +264,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 +276,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 +283,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;