X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fmain.c;h=caecd6a4b7f0d66fff4334f0fae494091a9767a9;hp=7443588857a361e1db474389df579a3394145a5d;hb=dc4645031b9bc9a71f3aafa5cb5d014e1ab16857;hpb=6633b74930870ffb148c46129c738af78082d934 diff --git a/src/main.c b/src/main.c index 74435888..caecd6a4 100644 --- a/src/main.c +++ b/src/main.c @@ -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 +#include "wget.h" #include #include @@ -36,14 +36,13 @@ so, delete this exception statement from your version. */ #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" @@ -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 #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 */ } /* Definition of command-line options. */ @@ -690,7 +688,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; @@ -708,7 +706,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. */ @@ -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) { @@ -1036,7 +1037,7 @@ Can't timestamp and not clobber old files at the same time.\n")); { logprintf (LOG_NOTQUIET, _("FINISHED --%s--\nDownloaded: %d files, %s in %s (%s)\n"), - time_str (time (NULL)), + datetime_str (time (NULL)), opt.numurls, human_readable (total_downloaded_bytes), secs_to_human_time (total_download_time),