summaryrefslogtreecommitdiffstats
path: root/ctxopt.c
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2020-06-12 23:33:38 +0200
committerpgen <p.gen.progs@gmail.com>2020-06-12 23:34:11 +0200
commit08843b46b7209b1ec2f32bea8ee17827fe64b217 (patch)
tree17c21a85bd8b9972c02e7fd8591d78ac015ad2f5 /ctxopt.c
parent850bee3e865c98b49eaa9cd666413bbe2a50a3b6 (diff)
Sync with github's ctxopt commit 8a28aa8
Diffstat (limited to 'ctxopt.c')
-rw-r--r--ctxopt.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ctxopt.c b/ctxopt.c
index 0032c89..d6f4a0f 100644
--- a/ctxopt.c
+++ b/ctxopt.c
@@ -1,7 +1,8 @@
-/* ########################################################### */
-/* This Software is licensed under the GPL licensed Version 2, */
-/* please read http://www.gnu.org/copyleft/gpl.html */
-/* ########################################################### */
+/* ################################################################### */
+/* This Source Code Form is subject to the terms of the Mozilla Public */
+/* License, v. 2.0. If a copy of the MPL was not distributed with this */
+/* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+/* ################################################################### */
#include <errno.h>
#include <limits.h>
@@ -77,9 +78,11 @@ typedef enum
leaf
} walk_order_e;
+#if 0 /* Unused yet */
static void *
bst_delete(const void * vkey, void ** vrootp,
int (*compar)(const void *, const void *));
+#endif
static void
bst_destroy(void * vrootp, void (*clean)(void *));
@@ -3201,6 +3204,11 @@ ctxopt_analyze(int nb_words, char ** words, int * nb_rem_args,
par_name = cli_node->data;
+ /* Replace a leading -- by a single - */
+ /* """""""""""""""""""""""""""""""""" */
+ if (strncmp(cli_node->data, "--", 2) == 0)
+ par_name += 1; /* Ignore the first dash */
+
if (strcmp(par_name, "\x1d") == 0)
{
check_for_missing_mandatory_opt(ctx_inst, (char *)(cli_node->prev->data));