summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 70cff3a)
raw | patch | inline | side by side (parent: 70cff3a)
author | Brian Hetro <whee@smaertness.net> | |
Sat, 5 Jul 2008 05:24:42 +0000 (01:24 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 6 Jul 2008 00:42:30 +0000 (17:42 -0700) |
Signed-off-by: Brian Hetro <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
convert.c | patch | blob | history |
diff --git a/convert.c b/convert.c
index 1c66844783ec3baa1373b3f0c41ea080bc7354fe..352b69d4ceeec411a81469a6146e023aa1d6b338 100644 (file)
--- a/convert.c
+++ b/convert.c
static struct convert_driver {
const char *name;
struct convert_driver *next;
- char *smudge;
- char *clean;
+ const char *smudge;
+ const char *clean;
} *user_convert, **user_convert_tail;
static int read_convert_config(const char *var, const char *value, void *cb)
* The command-line will not be interpolated in any way.
*/
- if (!strcmp("smudge", ep)) {
- if (!value)
- return config_error_nonbool(var);
- drv->smudge = strdup(value);
- return 0;
- }
+ if (!strcmp("smudge", ep))
+ return git_config_string(&drv->smudge, var, value);
+
+ if (!strcmp("clean", ep))
+ return git_config_string(&drv->clean, var, value);
- if (!strcmp("clean", ep)) {
- if (!value)
- return config_error_nonbool(var);
- drv->clean = strdup(value);
- return 0;
- }
return 0;
}
struct git_attr_check check[3];
int crlf = CRLF_GUESS;
int ident = 0, ret = 0;
- char *filter = NULL;
+ const char *filter = NULL;
setup_convert_check(check);
if (!git_checkattr(path, ARRAY_SIZE(check), check)) {
@@ -606,7 +599,7 @@ int convert_to_working_tree(const char *path, const char *src, size_t len, struc
struct git_attr_check check[3];
int crlf = CRLF_GUESS;
int ident = 0, ret = 0;
- char *filter = NULL;
+ const char *filter = NULL;
setup_convert_check(check);
if (!git_checkattr(path, ARRAY_SIZE(check), check)) {