X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fmain.c;h=d2a55c51cb1e82a8fad90e46f3d95a7890f4eef7;hp=2c30843007fe500b4d976d6c0a04c1478e13a7ef;hb=462e643a7e31676eceda23e634241f7b4d2cd7bb;hpb=3073a77ed89e7d9527d110a028d134bfd1f9cb40 diff --git a/src/main.c b/src/main.c index 2c308430..d2a55c51 100644 --- a/src/main.c +++ b/src/main.c @@ -28,7 +28,7 @@ Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL used as well as that of the covered work. */ -#include +#include "wget.h" #include #include @@ -37,14 +37,13 @@ as that of the covered work. */ #endif /* HAVE_UNISTD_H */ #include #include -#ifdef HAVE_NLS +#ifdef ENABLE_NLS # include #endif #include #include #include -#include "wget.h" #include "utils.h" #include "init.h" #include "retr.h" @@ -56,8 +55,7 @@ as that of the covered work. */ #include "spider.h" #include "http.h" /* for save_cookies */ -/* On GNU system this will include system-wide getopt.h. */ -#include "getopt.h" +#include #ifndef PATH_SEPARATOR # define PATH_SEPARATOR '/' @@ -81,14 +79,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 */ } /* Definition of command-line options. */ @@ -691,7 +689,7 @@ There is NO WARRANTY, to the extent permitted by law.\n"), stdout); int -main (int argc, char *const *argv) +main (int argc, char **argv) { char **url, **t; int i, ret, longindex; @@ -709,7 +707,7 @@ main (int argc, char *const *argv) #ifdef WINDOWS /* Drop extension (typically .EXE) from executable filename. */ - windows_main (&argc, (char **) argv, (char **) &exec_name); + windows_main ((char **) &exec_name); #endif /* Set option defaults; read the system wgetrc and ~/.wgetrc. */ @@ -813,9 +811,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; @@ -834,7 +832,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) {