dir.c: replace home_config_paths() with xdg_config_home()
[gitweb.git] / attr.c
diff --git a/attr.c b/attr.c
index 734222dc45c588736f963dea7907258e76024415..c82904b6f291b2285f72afc1fa38244a9fa7669b 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -97,8 +97,7 @@ static struct git_attr *git_attr_internal(const char *name, int len)
        a->attr_nr = attr_nr++;
        git_attr_hash[pos] = a;
 
-       check_all_attr = xrealloc(check_all_attr,
-                                 sizeof(*check_all_attr) * attr_nr);
+       REALLOC_ARRAY(check_all_attr, attr_nr);
        check_all_attr[a->attr_nr].attr = a;
        check_all_attr[a->attr_nr].value = ATTR__UNKNOWN;
        return a;
@@ -479,7 +478,6 @@ static int git_attr_system(void)
 static void bootstrap_attr_stack(void)
 {
        struct attr_stack *elem;
-       char *xdg_attributes_file;
 
        if (attr_stack)
                return;
@@ -498,10 +496,8 @@ static void bootstrap_attr_stack(void)
                }
        }
 
-       if (!git_attributes_file) {
-               home_config_paths(NULL, &xdg_attributes_file, "attributes");
-               git_attributes_file = xdg_attributes_file;
-       }
+       if (!git_attributes_file)
+               git_attributes_file = xdg_config_home("attributes");
        if (git_attributes_file) {
                elem = read_attr_from_file(git_attributes_file, 1);
                if (elem) {