version 1.142, 2019/03/18 11:58:40 |
version 1.143, 2019/04/23 20:36:55 |
|
|
{ |
{ |
struct options_entry *o; |
struct options_entry *o; |
struct options_array_item *a; |
struct options_array_item *a; |
|
union options_value *ov; |
int old_argc = *argc, new_argc, i; |
int old_argc = *argc, new_argc, i; |
char **old_argv = *argv, **new_argv; |
char **old_argv = *argv, **new_argv; |
size_t wanted; |
size_t wanted; |
const char *s, *cp = NULL; |
const char *cp = NULL; |
|
|
o = options_get_only(global_options, "command-alias"); |
o = options_get_only(global_options, "command-alias"); |
if (o == NULL) |
if (o == NULL) |
|
|
|
|
a = options_array_first(o); |
a = options_array_first(o); |
while (a != NULL) { |
while (a != NULL) { |
s = options_array_item_value(a); |
ov = options_array_item_value(a); |
if (s != NULL) { |
if (ov == NULL) { |
cp = strchr(s, '='); |
a = options_array_next(a); |
if (cp != NULL && |
continue; |
(size_t)(cp - s) == wanted && |
|
strncmp(old_argv[0], s, wanted) == 0) |
|
break; |
|
} |
} |
|
cp = strchr(ov->string, '='); |
|
if (cp != NULL && |
|
(size_t)(cp - ov->string) == wanted && |
|
strncmp(old_argv[0], ov->string, wanted) == 0) |
|
break; |
a = options_array_next(a); |
a = options_array_next(a); |
} |
} |
if (a == NULL) |
if (a == NULL) |