t4013-diff-various.sh: use the $( ... ) construct for command substitution
[gitweb.git] / parse-options.c
index 7b8d3faa171309e84bff23c70206a9c8bd99cc71..a5fa0b8938cb2820635bbc620b1b26cc903a6c97 100644 (file)
@@ -223,13 +223,10 @@ static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg,
                           const struct option *options)
 {
        const struct option *all_opts = options;
-       const char *arg_end = strchr(arg, '=');
+       const char *arg_end = strchrnul(arg, '=');
        const struct option *abbrev_option = NULL, *ambiguous_option = NULL;
        int abbrev_flags = 0, ambiguous_flags = 0;
 
-       if (!arg_end)
-               arg_end = arg + strlen(arg);
-
        for (; options->type != OPTION_END; options++) {
                const char *rest, *long_name = options->long_name;
                int flags = 0, opt_flags = 0;