]> sjero.net Git - wget/commitdiff
Merging heads.
authorMicah Cowan <micah@cowan.name>
Fri, 16 May 2008 05:36:20 +0000 (22:36 -0700)
committerMicah Cowan <micah@cowan.name>
Fri, 16 May 2008 05:36:20 +0000 (22:36 -0700)
1  2 
ChangeLog
src/ChangeLog
src/ftp.c
src/http.c
src/main.c

diff --cc ChangeLog
index 697f2ca6da2f469ccdc5b85e5731f946ec12da33,ad4c460c6bb45ec7f4c3abaf21386cc9868e2f97..1a20b3c6186bf140767485152f2ad0571981f260
+++ b/ChangeLog
@@@ -1,7 -1,8 +1,12 @@@
 -          conjunction with '-O file'.
 +2008-05-15  Micah Cowan  <micah@cowan.name>
 +
 +      * NEWS: Entry for --ask-password.
 +
+ 2008-05-14  Joao Ferreira  <joao@joaoff.com>
+       * src/main.c, src/http.c, src/ftp.c: -nc is now working in 
++      conjunction with '-O file'.
  2008-05-12  Micah Cowan  <micah@cowan.name>
  
        * NEWS: Translations and -N/-O.
diff --cc src/ChangeLog
index c5edf7a32f3eb5693395faa74237a5ef1feb4820,149bc521dc86a801bfe9022dcc76b98d0f0f3421..0d4c94b53a664c33e20ed55feb9f55ce24ffbf02
@@@ -1,12 -1,8 +1,17 @@@
+ 2008-05-15  Steven Schubiger  <schubiger@gmail.com>
+       * ftp.c (getftp): Verify that the file actually exists in FTP, by
+       checking it against the listing.
 +2008-05-15  Micah Cowan  <micah@cowan.name>
 +
 +      * main.c (prompt_for_password): Use the quote module.
 +
 +2008-05-14  Micah Cowan  <micah@cowan.name>
 +
 +      * ftp.c (ftp_retrieve_list): Symlinks and other filenames
 +      should be fully quoted.
 +
  2008-05-12  Micah Cowan  <micah@cowan.name>
  
        * main.c (main): Downgrade "-N with -O" to a warning, and switch
diff --cc src/ftp.c
index 0ecc6bcb1dafbb417ed12922f75b3f433e83a812,5bfd2aa8ac526d8925bdd97177eab4287392f233..17df502996cae7154b8cb0d7b82f3fa3bd692d6f
+++ b/src/ftp.c
@@@ -1096,10 -1118,12 +1123,12 @@@ ftp_loop_internal (struct url *u, struc
    if (!con->target)
      con->target = url_file_name (u);
  
-   if (opt.noclobber && file_exists_p (con->target))
+   /* If the output_document was given, then this check was already done and
+      the file didn't exist. Hence the !opt.output_document */
+   if (opt.noclobber && !opt.output_document && file_exists_p (con->target))
      {
        logprintf (LOG_VERBOSE,
 -                 _("File `%s' already there; not retrieving.\n"), con->target);
 +                 _("File %s already there; not retrieving.\n"), quote (con->target));
        /* If the file is there, we suppose it's retrieved OK.  */
        return RETROK;
      }
diff --cc src/http.c
index 0252d3421f07f491a59c443f50ab08aa6480d2af,20f0619ad570835dc531349a9cc1a8d5f482cc0d..11dc9cc8f7d08c2678e09a486f135e21118e16de
@@@ -1823,12 -1821,13 +1823,13 @@@ gethttp (struct url *u, struct http_sta
    /* TODO: perform this check only once. */
    if (!hs->existence_checked && file_exists_p (hs->local_file))
      {
-       if (opt.noclobber)
+       if (opt.noclobber && !opt.output_document)
          {
            /* If opt.noclobber is turned on and file already exists, do not
-              retrieve the file */
+              retrieve the file. But if the output_document was given, then this
+              test was already done and the file didn't exist. Hence the !opt.output_document */
            logprintf (LOG_VERBOSE, _("\
 -File `%s' already there; not retrieving.\n\n"), hs->local_file);
 +File %s already there; not retrieving.\n\n"), quote (hs->local_file));
            /* If the file is there, we suppose it's retrieved OK.  */
            *dt |= RETROKF;
  
@@@ -2376,13 -2375,14 +2377,14 @@@ http_loop (struct url *u, char **newloc
  
    /* TODO: Ick! This code is now in both gethttp and http_loop, and is
     * screaming for some refactoring. */
-   if (got_name && file_exists_p (hstat.local_file) && opt.noclobber)
+   if (got_name && file_exists_p (hstat.local_file) && opt.noclobber && !opt.output_document)
      {
        /* If opt.noclobber is turned on and file already exists, do not
-          retrieve the file */
+          retrieve the file. But if the output_document was given, then this
+          test was already done and the file didn't exist. Hence the !opt.output_document */
        logprintf (LOG_VERBOSE, _("\
 -File `%s' already there; not retrieving.\n\n"), 
 -                 hstat.local_file);
 +File %s already there; not retrieving.\n\n"), 
 +                 quote (hstat.local_file));
        /* If the file is there, we suppose it's retrieved OK.  */
        *dt |= RETROKF;
  
diff --cc src/main.c
index e239b6d009ff0aa71456ed150aacc7a69c585e0b,fdf368a51fc2e897e9fc2e236a8d5e9744bea2f5..159973a0021a2e36e80d5c389f8c40fa38f3b91e
@@@ -920,15 -905,14 +920,21 @@@ WARNING: timestamping does nothing in c
  for details.\n\n"));
            opt.timestamping = false;
          }
+       if (opt.noclobber && file_exists_p(opt.output_document)) 
+            { 
+               /* Check if output file exists; if it does, exit. */
+               logprintf (LOG_VERBOSE, _("File `%s' already there; not retrieving.\n"), opt.output_document);
+               exit(1);
+            }  
      }
  
 +  if (opt.ask_passwd && opt.passwd)
 +    {
 +      printf (_("Cannot specify both --ask-password and --password.\n"));
 +      print_usage ();
 +      exit (1);
 +    }
 +
    if (!nurl && !opt.input_filename)
      {
        /* No URL specified.  */