diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-09-18 09:54:42 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-09-18 09:54:42 +0200 |
commit | f9671c1ee14a5bcad05d48b7aa7f943ad15cb125 (patch) | |
tree | d00984dd9cdd571125940b152f3adec505198f9a | |
parent | ae3dc14ec1d63ae3677b017c7f6295d99ce1e7ca (diff) | |
download | curl-f9671c1ee14a5bcad05d48b7aa7f943ad15cb125.tar.gz |
fixup free the category string in all cases
-rw-r--r-- | src/tool_help.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/tool_help.c b/src/tool_help.c index 306e54b96..aeb40b098 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -905,26 +905,21 @@ void tool_help(const char *category) /* If no category was provided */ if(!category) { const char *category_note = "\nThis is not the full help, this " - "menu is stripped into categories.\nUse \"--help category\" to get " - "an overview of all categories.\nFor all options use the manual" - " or \"--help all\"."; + "menu is stripped into categories.\nUse \"--help category\" to get " + "an overview of all categories.\nFor all options use the manual" + " or \"--help all\"."; print_category(CURLHELP_IMPORTANT); puts(category_note); - return; } /* Lets print everything if "all" was provided */ - if(curl_strequal(category, "all")) { + else if(curl_strequal(category, "all")) /* Print everything except hidden */ print_category(~(CURLHELP_HIDDEN)); - return; - } /* Lets handle the string "category" differently to not print an errormsg */ - if(curl_strequal(category, "category")) { + else if(curl_strequal(category, "category")) get_categories(); - return; - } /* Otherwise print category and handle the case if the cat was not found */ - if(get_category_content(category)) { + else if(get_category_content(category)) { puts("Invalid category provided, here is a list of all categories:\n"); get_categories(); } |