From 296f60f56da4854d746984415e7e9887796d4e64 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Fri, 6 Jul 2012 00:54:07 +0200 Subject: [PATCH] Fix libgit2 on GNU/Hurd. On GNU, the d_name field of the dirent structure is defined as "char d_name[1]", so we must allocate more than sizeof(struct dirent) bytes, just like on Sun. --- src/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/path.c b/src/path.c index a6574b3de..9c88240e0 100644 --- a/src/path.c +++ b/src/path.c @@ -515,7 +515,7 @@ int git_path_direach( return -1; } -#ifdef __sun +#if defined(__sun) || defined(__GNU__) de_buf = git__malloc(sizeof(struct dirent) + FILENAME_MAX + 1); #else de_buf = git__malloc(sizeof(struct dirent)); @@ -569,7 +569,7 @@ int git_path_dirload( return -1; } -#ifdef __sun +#if defined(__sun) || defined(__GNU__) de_buf = git__malloc(sizeof(struct dirent) + FILENAME_MAX + 1); #else de_buf = git__malloc(sizeof(struct dirent));