]> sjero.net Git - wget/blobdiff - src/ftp.c
[svn] Implemented and documented new -E / --html-extension / html_extension option.
[wget] / src / ftp.c
index ef611d32df7c936a76577fdaf930100bdcb65d00..1f65c254dd4b6bd804a36e52e7bd339f281ab009 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -969,7 +969,7 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con)
 
       /* If we get out of the switch above without continue'ing, we've
         successfully downloaded a file.  Remember this fact. */
-      downloaded_file(ADD_FILE, locf);
+      downloaded_file(FILE_DOWNLOADED_NORMALLY, locf);
 
       if (con->st & ON_YOUR_OWN)
        {
@@ -1068,7 +1068,7 @@ ftp_retrieve_list (struct urlinfo *u, struct fileinfo *f, ccon *con)
 
   /* Increase the depth.  */
   ++depth;
-  if (opt.reclevel && depth > opt.reclevel)
+  if (opt.reclevel != INFINITE_RECURSION && depth > opt.reclevel)
     {
       DEBUGP ((_("Recursion depth %d exceeded max. depth %d.\n"),
               depth, opt.reclevel));
@@ -1221,7 +1221,7 @@ Already have correct symlink %s -> %s\n\n"),
       else if (f->tstamp == -1)
        logprintf (LOG_NOTQUIET, _("%s: corrupt time-stamp.\n"), u->local);
 
-      if (f->perms && dlthis)
+      if (f->perms && f->type == FT_PLAINFILE && dlthis)
        chmod (u->local, f->perms);
       else
        DEBUGP (("Unrecognized permissions for %s.\n", u->local));
@@ -1236,7 +1236,8 @@ Already have correct symlink %s -> %s\n\n"),
       f = f->next;
     } /* while */
   /* We do not want to call ftp_retrieve_dirs here */
-  if (opt.recursive && !(opt.reclevel && depth >= opt.reclevel))
+  if (opt.recursive &&
+      !(opt.reclevel != INFINITE_RECURSION && depth >= opt.reclevel))
     err = ftp_retrieve_dirs (u, orig, con);
   else if (opt.recursive)
     DEBUGP ((_("Will not retrieve dirs since depth is %d (max %d).\n"),