diff options
author | pgen <p.gen.progs@gmail.com> | 2020-06-12 23:33:38 +0200 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2020-06-12 23:34:11 +0200 |
commit | 08843b46b7209b1ec2f32bea8ee17827fe64b217 (patch) | |
tree | 17c21a85bd8b9972c02e7fd8591d78ac015ad2f5 /ctxopt.c | |
parent | 850bee3e865c98b49eaa9cd666413bbe2a50a3b6 (diff) |
Sync with github's ctxopt commit 8a28aa8
Diffstat (limited to 'ctxopt.c')
-rw-r--r-- | ctxopt.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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)); |