]> sjero.net Git - wget/blobdiff - src/ftp-ls.c
[svn] Declare the pointers to literal strings as `const'.
[wget] / src / ftp-ls.c
index d1172de520f9ddf1dc64d7854bd7a5879d43b7f6..189bad9325699fa21c6d0ecac951a020d82c505d 100644 (file)
@@ -48,6 +48,8 @@ so, delete this exception statement from your version.  */
 #include "ftp.h"
 #include "url.h"
 
+extern FILE *output_stream;
+
 /* Converts symbolic permissions to number-style ones, e.g. string
    rwxr-xr-x to 755.  For now, it knows nothing of
    setuid/setgid/sticky.  ACLs are ignored.  */
@@ -827,7 +829,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
   char *upwd;
   char *htclfile;              /* HTML-clean file name */
 
-  if (!opt.dfp)
+  if (!output_stream)
     {
       fp = fopen (file, "wb");
       if (!fp)
@@ -837,7 +839,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
        }
     }
   else
-    fp = opt.dfp;
+    fp = output_stream;
   if (u->user)
     {
       char *tmpu, *tmpp;        /* temporary, clean user and passwd */
@@ -865,7 +867,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
        {
          /* #### Should we translate the months?  Or, even better, use
             ISO 8601 dates?  */
-         static char *months[] = {
+         static const char *months[] = {
            "Jan", "Feb", "Mar", "Apr", "May", "Jun",
            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
          };
@@ -919,7 +921,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
     }
   fprintf (fp, "</pre>\n</body>\n</html>\n");
   xfree (upwd);
-  if (!opt.dfp)
+  if (!output_stream)
     fclose (fp);
   else
     fflush (fp);