summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--attr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/attr.c b/attr.c
index 466c93fa50..bb9a470c85 100644
--- a/attr.c
+++ b/attr.c
@@ -584,6 +584,13 @@ static void prepare_attr_stack(const char *path)
dirlen = find_basename(path) - path;
/*
+ * find_basename() includes the trailing slash, but we do
+ * _not_ want it.
+ */
+ if (dirlen)
+ dirlen--;
+
+ /*
* At the bottom of the attribute stack is the built-in
* set of attribute definitions, followed by the contents
* of $(prefix)/etc/gitattributes and a file specified by