Commit 296f60f5 by Cyril Roelandt

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.
parent b00e9216
...@@ -515,7 +515,7 @@ int git_path_direach( ...@@ -515,7 +515,7 @@ int git_path_direach(
return -1; return -1;
} }
#ifdef __sun #if defined(__sun) || defined(__GNU__)
de_buf = git__malloc(sizeof(struct dirent) + FILENAME_MAX + 1); de_buf = git__malloc(sizeof(struct dirent) + FILENAME_MAX + 1);
#else #else
de_buf = git__malloc(sizeof(struct dirent)); de_buf = git__malloc(sizeof(struct dirent));
...@@ -569,7 +569,7 @@ int git_path_dirload( ...@@ -569,7 +569,7 @@ int git_path_dirload(
return -1; return -1;
} }
#ifdef __sun #if defined(__sun) || defined(__GNU__)
de_buf = git__malloc(sizeof(struct dirent) + FILENAME_MAX + 1); de_buf = git__malloc(sizeof(struct dirent) + FILENAME_MAX + 1);
#else #else
de_buf = git__malloc(sizeof(struct dirent)); de_buf = git__malloc(sizeof(struct dirent));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment