]> sjero.net Git - wget/blobdiff - src/main.c
Merging to bring en@*.po back in (and removed from .hgignore).
[wget] / src / main.c
index f60d0c0a940b0a3f0bc4a3392d8d9cc7c17a269e..caecd6a4b7f0d66fff4334f0fae494091a9767a9 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -36,14 +36,13 @@ so, delete this exception statement from your version.  */
 #endif /* HAVE_UNISTD_H */
 #include <string.h>
 #include <signal.h>
-#ifdef HAVE_NLS
+#ifdef ENABLE_NLS
 # include <locale.h>
 #endif
 #include <assert.h>
 #include <errno.h>
 #include <time.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "init.h"
 #include "retr.h"
@@ -55,8 +54,7 @@ so, delete this exception statement from your version.  */
 #include "spider.h"
 #include "http.h"               /* for save_cookies */
 
-/* On GNU system this will include system-wide getopt.h. */
-#include "getopt.h"
+#include <getopt.h>
 
 #ifndef PATH_SEPARATOR
 # define PATH_SEPARATOR '/'
@@ -80,14 +78,14 @@ const char *exec_name;
 static void
 i18n_initialize (void)
 {
-  /* HAVE_NLS implies existence of functions invoked here.  */
-#ifdef HAVE_NLS
+  /* ENABLE_NLS implies existence of functions invoked here.  */
+#ifdef ENABLE_NLS
   /* Set the current locale.  */
   setlocale (LC_ALL, "");
   /* Set the text message domain.  */
   bindtextdomain ("wget", LOCALEDIR);
   textdomain ("wget");
-#endif /* HAVE_NLS */
+#endif /* ENABLE_NLS */
 }
 \f
 /* Definition of command-line options. */
@@ -690,7 +688,7 @@ There is NO WARRANTY, to the extent permitted by law.\n"), stdout);
 \f
 
 int
-main (int argc, char *const *argv)
+main (int argc, char **argv)
 {
   char **url, **t;
   int i, ret, longindex;
@@ -812,9 +810,9 @@ main (int argc, char *const *argv)
                before passing the value to setoptval.  */
             bool flag = true;
             if (optarg)
-              flag = (*optarg == '1' || TOLOWER (*optarg) == 'y'
-                      || (TOLOWER (optarg[0]) == 'o'
-                          && TOLOWER (optarg[1]) == 'n'));
+              flag = (*optarg == '1' || c_tolower (*optarg) == 'y'
+                      || (c_tolower (optarg[0]) == 'o'
+                          && c_tolower (optarg[1]) == 'n'));
             setoptval (opt->type == OPT__PARENT ? "noparent" : "noclobber",
                        flag ? "0" : "1", opt->long_name);
             break;
@@ -833,7 +831,10 @@ main (int argc, char *const *argv)
      interoption dependency checks. */
 
   if (opt.reclevel == 0)
-    opt.reclevel = INFINITE_RECURSION; /* see recur.h for commentary on this */
+      opt.reclevel = INFINITE_RECURSION; /* see recur.h for commentary */
+
+  if (opt.spider || opt.delete_after)
+      opt.no_dirstruct = true;
 
   if (opt.page_requisites && !opt.recursive)
     {