git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/6] diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
@ 2008-02-16  5:02 Christian Couder
  0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2008-02-16  5:02 UTC (permalink / raw)
  To: git; +Cc: Junio Hamano, Pierre Habouzit, Martin Koegler, Johannes Sixt

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

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 diff.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/diff.c b/diff.c
index 5640cbf..173bb61 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);
 }
 
 /*
-- 
1.5.4.1.129.gf12af-dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-16  4:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-16  5:02 [PATCH 6/6] diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver" Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).