diff options
author | nikita <tek.no.katze@gmail.com> | 2020-04-01 14:27:11 +0200 |
---|---|---|
committer | nikita <tek.no.katze@gmail.com> | 2020-04-01 14:27:11 +0200 |
commit | 10e1f0a795a8d2375eeb30b01c71363fdbcc5895 (patch) | |
tree | b6c084e5021b8d5c40b6aecd495798d187d2fcd5 /src/tool_main.c | |
parent | 69758416170305e04324a85bfe74cd62673e298b (diff) | |
parent | b81e0b07784dc4c1e8d0a86194b9d28776d071c0 (diff) | |
download | gnurl-10e1f0a795a8d2375eeb30b01c71363fdbcc5895.tar.gz gnurl-10e1f0a795a8d2375eeb30b01c71363fdbcc5895.tar.bz2 gnurl-10e1f0a795a8d2375eeb30b01c71363fdbcc5895.zip |
Merge tag 'curl-7_69_1'
7.69.1
Diffstat (limited to 'src/tool_main.c')
-rw-r--r-- | src/tool_main.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/tool_main.c b/src/tool_main.c index 06923c332..25042895f 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -279,6 +279,24 @@ int main(int argc, char *argv[]) struct GlobalConfig global; memset(&global, 0, sizeof(global)); +#ifdef WIN32 + /* Undocumented diagnostic option to list the full paths of all loaded + modules. This is purposely pre-init. */ + if(argc == 2 && !strcmp(argv[1], "--dump-module-paths")) { + struct curl_slist *item, *head = GetLoadedModulePaths(); + for(item = head; item; item = item->next) + printf("%s\n", item->data); + curl_slist_free_all(head); + return head ? 0 : 1; + } + /* win32_init must be called before other init routines. */ + result = win32_init(); + if(result) { + fprintf(stderr, "curl: (%d) Windows-specific init failed.\n", result); + return result; + } +#endif + /* Perform any platform-specific terminal configuration */ configure_terminal(); @@ -294,21 +312,6 @@ int main(int argc, char *argv[]) /* Initialize the curl library - do not call any libcurl functions before this point */ result = main_init(&global); - -#ifdef WIN32 - /* Undocumented diagnostic option to list the full paths of all loaded - modules, regardless of whether or not initialization succeeded. */ - if(argc == 2 && !strcmp(argv[1], "--dump-module-paths")) { - struct curl_slist *item, *head = GetLoadedModulePaths(); - for(item = head; item; item = item->next) { - printf("%s\n", item->data); - } - curl_slist_free_all(head); - if(!result) - main_free(&global); - } - else -#endif /* WIN32 */ if(!result) { /* Start our curl operation */ result = operate(&global, argc, argv); |