Permalink
Browse files

Allow overwriting of a previously set "argv" option

parse_args() is only used by option_set_command() for the two "argv"
style options: blame-options and diff-options.  Allowing parse_args() to
overwrite the destination enables ":set diff-options = ..." to work more
than once from within the tig prompt (or at all if first set via tigrc).

This is safe since argv_copy() handles the necessary freeing, added as
part of 7dfa0b2.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
  • Loading branch information...
1 parent 3567c4e commit a2887de61e8a06ed640d4da2c9469136b208409d @tsibley tsibley committed with Feb 11, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 tig.c
View
2 tig.c
@@ -1408,7 +1408,7 @@ parse_encoding(struct encoding **encoding_ref, const char *arg, bool priority)
static enum option_code
parse_args(const char ***args, const char *argv[])
{
- if (*args == NULL && !argv_copy(args, argv))
+ if (!argv_copy(args, argv))
return OPT_ERR_OUT_OF_MEMORY;
return OPT_OK;
}

0 comments on commit a2887de

Please sign in to comment.