From 12a702814f96ec1d07487c7afa877c3882b5226a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 12 Oct 2025 15:58:43 +0200 Subject: [PATCH] tool_getparam: make --fail and --fail-with-body override each other This allows users to put one of them in their .curlrc and still easily use the other one at will in command lines. Reported-by: Mitchell Blank Jr Fixes #19029 --- src/tool_getparam.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tool_getparam.c b/src/tool_getparam.c index b533f41aa7..638bb987f6 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -2040,9 +2040,8 @@ static ParameterError opt_bool(struct OperationConfig *config, case C_FAIL_WITH_BODY: /* --fail-with-body */ config->failwithbody = toggle; if(config->failonerror && config->failwithbody) { - errorf("You must select either --fail or " - "--fail-with-body, not both."); - return PARAM_BAD_USE; + warnf("--fail-with-body deselects --fail here"); + config->failonerror = FALSE; } break; case C_REMOVE_ON_ERROR: /* --remove-on-error */ @@ -2055,9 +2054,8 @@ static ParameterError opt_bool(struct OperationConfig *config, case C_FAIL: /* --fail */ config->failonerror = toggle; if(config->failonerror && config->failwithbody) { - errorf("You must select either --fail or " - "--fail-with-body, not both."); - return PARAM_BAD_USE; + warnf("--fail deselects --fail-with-body here"); + config->failwithbody = FALSE; } break; case C_GLOBOFF: /* --globoff */