On OS X, if a filename on the FTP server contains spaces, and the remote copy of the file is newer than the local, then wget gets thrown into a loop of "No such file or directory" endlessly. I have changed the following in ftp-simple.c, and this fixes the error. Sorry, I don't know how to use the proper patch formatting, but it should be clear.

==================================
the beginning of ftp_retr:
=================================
/* Sends RETR command to the FTP server.  */
uerr_t
ftp_retr (int csock, const char *file)
{
  char *request, *respline;
  int nwritten;
  uerr_t err;

  /* Send RETR request.  */
  request = ftp_request ("RETR", file);

==================================
becomes:
==================================
/* Sends RETR command to the FTP server.  */
uerr_t
ftp_retr (int csock, const char *file)
{
  char *request, *respline;
  int nwritten;
  uerr_t err;
  char filecopy[2048];
  if (file[0] != '"') {
    sprintf(filecopy, "\"%.2047s\"", file);
  } else {
    strncpy(filecopy, file, 2047);
  }

  /* Send RETR request.  */
  request = ftp_request ("RETR", filecopy);






--
Rich "wealthychef" Cook
925-784-3077
--
it takes many small steps to climb a mountain, but the view gets better all the time.


Reply via email to