Commit 913c3c8f authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl: non-boolean command line args reject --no- prefixes

... and instead properly respond with an error message to the user
instead of silently ignoring.

Fixes #1453
Closes #1458
parent f2d5d058
Loading
Loading
Loading
Loading
+225 −219

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Changes for src/tool_getparam.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2017, 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
@@ -40,6 +40,7 @@ typedef enum {
  PARAM_LIBCURL_UNSUPPORTED_PROTOCOL,
  PARAM_NO_MEM,
  PARAM_NEXT_OPERATION,
  PARAM_NO_PREFIX,
  PARAM_LAST
} ParameterError;

+3 −1
Changes for src/tool_helpers.c: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2017, 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
@@ -62,6 +62,8 @@ const char *param2text(int res)
    return "a specified protocol is unsupported by libcurl";
  case PARAM_NO_MEM:
    return "out of memory";
  case PARAM_NO_PREFIX:
    return "the given option can't be reversed with a --no- prefix";
  default:
    return "unknown error";
  }