aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-02-16 06:02:17 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-15 21:24:54 -0800
commitb20a60d0c0f23384cb4141d75d9a7c90e99c1432 (patch)
tree8b9070b5351c6df86e63b0009e7689409d08eeaf /diff.c
parentdfb068be8deef2065970b2a7889acc51abf4dd78 (diff)
downloadgit-b20a60d0c0f23384cb4141d75d9a7c90e99c1432.tar.gz
git-b20a60d0c0f23384cb4141d75d9a7c90e99c1432.tar.xz
diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index ed41ce418..f082f55bc 100644
--- a/diff.c
+++ b/diff.c
@@ -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;
/*
@@ -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);
}
/*