Skip to content

Commit 32c60a6

Browse files
carenasgitster
authored andcommitted
portability: allow building in systems without d_type
Since 09fb155 (diff --no-index: support limiting by pathspec, 2025-05-21) git fails to build on platforms that don't have a d_type member on their struct dirent (ex: AIX, NonStop). Use the DTYPE() macro instead of a direct reference to d_type. Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Reviewed-by: Collin Funk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 09fb155 commit 32c60a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff-no-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static int read_directory_contents(const char *path, struct string_list *list,
4646

4747
if (!match_leading_pathspec(NULL, pathspec,
4848
match.buf, match.len,
49-
0, NULL, e->d_type == DT_DIR ? 1 : 0))
49+
0, NULL, DTYPE(e) == DT_DIR ? 1 : 0))
5050
continue;
5151
}
5252

0 commit comments

Comments
 (0)