From a5e92abde61d59a8612c5b87d0bae681e90f7fdb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 18 Apr 2007 16:16:37 -0700 Subject: Fix funny types used in attribute value representation It was bothering me a lot that I abused small integer values casted to (void *) to represent non string values in gitattributes. This corrects it by making the type of attribute values (const char *), and using the address of a few statically allocated character buffer to denote true/false. Unset attributes are represented as having NULLs as their values. Added in-header documentation to explain how git_checkattr() routine should be called. Signed-off-by: Junio C Hamano --- convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'convert.c') diff --git a/convert.c b/convert.c index 68bb70f12f..a5f60c7c6b 100644 --- a/convert.c +++ b/convert.c @@ -226,7 +226,7 @@ static int git_path_check_crlf(const char *path) setup_crlf_check(&attr_crlf_check); if (!git_checkattr(path, 1, &attr_crlf_check)) { - void *value = attr_crlf_check.value; + const char *value = attr_crlf_check.value; if (ATTR_TRUE(value)) return 1; else if (ATTR_FALSE(value)) -- cgit v1.2.1