X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=parse-options.c;h=8546d8526f311e2a2703c258a4da3f02f8650df4;hb=b17847884ff7c122621123d4a3e0e65f046b07a8;hp=c83035d013d3f50e9367f2b07d49cf17a1e22ff6;hpb=b6a7a06aa6f083f21b0fca2558c737324eda1602;p=git.git diff --git a/parse-options.c b/parse-options.c index c83035d01..8546d8526 100644 --- a/parse-options.c +++ b/parse-options.c @@ -659,3 +659,18 @@ int parse_opt_tertiary(const struct option *opt, const char *arg, int unset) *target = unset ? 2 : 1; return 0; } + +int parse_options_concat(struct option *dst, size_t dst_size, struct option *src) +{ + int i, j; + + for (i = 0; i < dst_size; i++) + if (dst[i].type == OPTION_END) + break; + for (j = 0; i < dst_size; i++, j++) { + dst[i] = src[j]; + if (src[j].type == OPTION_END) + return 0; + } + return -1; +}