Skip to content

Commit

Permalink
diff.c: add "const" qualifier to "char *cmd" member of "struct ll_dif…
Browse files Browse the repository at this point in the history
…f_driver"

Also use "git_config_string" to simplify code where "cmd" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Feb 16, 2008
1 parent dfb068b commit b20a60d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int parse_diff_color_slot(const char *var, int ofs)
static struct ll_diff_driver {
const char *name;
struct ll_diff_driver *next;
char *cmd;
const char *cmd;
} *user_diff, **user_diff_tail;

/*
Expand Down Expand Up @@ -86,10 +86,7 @@ static int parse_lldiff_command(const char *var, const char *ep, const char *val
user_diff_tail = &(drv->next);
}

if (!value)
return config_error_nonbool(var);
drv->cmd = xstrdup(value);
return 0;
return git_config_string(&(drv->cmd), var, value);
}

/*
Expand Down

0 comments on commit b20a60d

Please sign in to comment.