]> sjero.net Git - wget/commitdiff
Adjust some typos from vms merge, and remove some elements we don't want to include...
authorMicah Cowan <micah@cowan.name>
Sun, 5 Jul 2009 01:42:59 +0000 (18:42 -0700)
committerMicah Cowan <micah@cowan.name>
Sun, 5 Jul 2009 01:42:59 +0000 (18:42 -0700)
src/convert.c
src/ftp-basic.c
src/ftp.h
src/retr.c
src/retr.h

index 1bf9d274d5923e819ee8ff6e4a456ffb8ec035cf..280d1b0c819f4bd6c5833a8c30d48acaeffd89e6 100644 (file)
@@ -444,9 +444,9 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return)
   else /* downloaded_file_return == FILE_DOWNLOADED_NORMALLY */
     {
       /* Append ".orig" to the name. */
-      filename_plus_orig_suffix = alloca (filename_len + sizeof ("ORIG_SFX"));
+      filename_plus_orig_suffix = alloca (filename_len + sizeof (ORIG_SFX));
       strcpy (filename_plus_orig_suffix, file);
-      strcpy (filename_plus_orig_suffix + filename_len, "ORIG_SFX");
+      strcpy (filename_plus_orig_suffix + filename_len, ORIG_SFX);
     }
 
   if (!converted_files)
index 0e11a8d3353a66d9385373dd47ea81be0e6690ad..8d3342c0c73acee808bbd48215871d5978d470dd 100644 (file)
@@ -889,42 +889,6 @@ ftp_cwd (int csock, const char *dir)
   return FTPOK;
 }
 
-/* Sends DELE command to the FTP server.  */
-uerr_t
-ftp_dele (int csock, const char *file)
-{
-  char *request, *respline;
-  int nwritten;
-  uerr_t err;
-
-  /* Send DELE request.  */
-  request = ftp_request ("DELE", file);
-  nwritten = fd_write (csock, request, strlen (request), -1.0);
-  if (nwritten < 0)
-    {
-      xfree (request);
-      return WRITEFAILED;
-    }
-  xfree (request);
-  /* Get appropriate response.  */
-  err = ftp_response (csock, &respline);
-  if (err != FTPOK)
-    return err;                 /* Return with early bad status. */
-
-  /* All OK, so far.  */
-  if (*respline == '5')
-    {
-      err = FTPNSFOD;           /* Permanent Negative Completion. */
-    }
-  else if (*respline != '2')    /* Success might be 226 or 250 (or ???). */
-    {
-      err = FTPRERR;            /* Not Positive Completion. */
-    }
-
-  xfree (respline);             /* Free "respline" storage. */
-  return err;                   /* Return response-based status code. */
-}
-
 /* Sends REST command to the FTP server.  */
 uerr_t
 ftp_rest (int csock, wgint offset)
index 9aa88d8b3de47a65fc0e75b42f9def77b5321fce..f0d5dc08b50052fa6876ababaaa6560083deb0ee 100644 (file)
--- a/src/ftp.h
+++ b/src/ftp.h
@@ -58,7 +58,6 @@ uerr_t ftp_epsv (int, ip_address *, int *);
 #endif
 uerr_t ftp_type (int, int);
 uerr_t ftp_cwd (int, const char *);
-uerr_t ftp_dele (int, const char *);
 uerr_t ftp_retr (int, const char *);
 uerr_t ftp_rest (int, wgint);
 uerr_t ftp_list (int, const char *, enum stype);
index 39627e4bbf5067e8ea563ac110c39c44e1cf087a..b667ca2ff3cf6ecb4edca9c1148e856f68b0ecbe 100644 (file)
@@ -143,10 +143,8 @@ limit_bandwidth (wgint bytes, struct ptimer *timer)
 
 static int
 write_data (FILE *out, const char *buf, int bufsize, wgint *skip,
-            wgint *written, int flags)
+            wgint *written)
 {
-  static int cr_pending = 0;    /* Found CR in ASCII FTP data. */
-
   if (!out)
     return 1;
   if (*skip > bufsize)
@@ -163,72 +161,8 @@ write_data (FILE *out, const char *buf, int bufsize, wgint *skip,
         return 1;
     }
 
-/* Note: This code assumes that "\n" is the universal line ending
-   character, as on UNIX and VMS.  If this is not true, then here's
-   where to change it.
-*/
-
-#if 1
-# define EOL_STRING "\n"
-#else /* 1 */
-# define EOL_STRING "\r\n"
-#endif /* 1 [else] */
-#define EOL_STRING_LEN (sizeof( EOL_STRING)- 1)
-
-  if (flags & rb_ftp_ascii)
-    {
-      const char *bufend;
-
-      /* ASCII transfer.  Put out lines delimited by CRLF. */
-      bufend = buf+ bufsize;
-      while (buf < bufend)
-        {
-          /* If CR, put out any pending CR, then set CR-pending flag. */
-          if (*buf == '\r')
-            {
-              if (cr_pending)
-                {
-                  fwrite ("\r", 1, 1, out);
-                  *written += 1;
-                }
-              cr_pending = 1;
-              buf++;
-              continue;
-            }
-
-          if (cr_pending)
-            {
-              if (*buf == '\n')
-                {
-                  /* Found FTP EOL (CRLF).  Put out local EOL. */
-                  fwrite (EOL_STRING, 1, EOL_STRING_LEN, out);
-                  *written += EOL_STRING_LEN;
-                }
-              else
-                {
-                  /* Normal character.  Put out pending CR and it. */
-                  fwrite ("\r", 1, 1, out);
-                  fwrite (buf, 1, 1, out);
-                  *written += 2;
-                }
-              buf++;
-              cr_pending = 0;
-            }
-          else
-            {
-              /* Normal character.  Put it out. */
-              fwrite (buf, 1, 1, out);
-              *written += 1;
-              buf++;
-            }
-        }
-    }
-  else
-    {
-      /* Image transfer.  Put out buffer. */
-      fwrite (buf, 1, bufsize, out);
-      *written += bufsize;
-    }
+  fwrite (buf, 1, bufsize, out);
+  *written += bufsize;
 
   /* Immediately flush the downloaded data.  This should not hinder
      performance: fast downloads will arrive in large 16K chunks
@@ -376,7 +310,7 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
       if (ret > 0)
         {
           sum_read += ret;
-          if (!write_data (out, dlbuf, ret, &skip, &sum_written, flags))
+          if (!write_data (out, dlbuf, ret, &skip, &sum_written))
             {
               ret = -2;
               goto out;
index 89a50221d9b5206a63f3846cb1e4be5a98923b56..8854b68404179a252f4dca1ce165dec1fec26104 100644 (file)
@@ -43,8 +43,7 @@ extern bool output_stream_regular;
 /* Flags for fd_read_body. */
 enum {
   rb_read_exactly  = 1,
-  rb_skip_startpos = 2,
-  rb_ftp_ascii     = 4
+  rb_skip_startpos = 2
 };
 
 int fd_read_body (int, FILE *, wgint, wgint, wgint *, wgint *, double *, int);