Skip to content

Commit fa9abe9

Browse files
kbleesgitster
authored andcommitted
Win32 dirent: change FILENAME_MAX to MAX_PATH
FILENAME_MAX and MAX_PATH are both 260 on Windows, however, MAX_PATH is used throughout the other Win32 code in Git, and also defines the length of file name buffers in the Win32 API (e.g. WIN32_FIND_DATA.cFileName, from which we're copying the dirent data). Signed-off-by: Karsten Blees <[email protected]> Signed-off-by: Erik Faye-Lund <[email protected]> Signed-off-by: Stepan Kasal <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b0601e6 commit fa9abe9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/win32/dirent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ typedef struct DIR DIR;
99
#define DT_LNK 3
1010

1111
struct dirent {
12-
char d_name[FILENAME_MAX]; /* File name. */
1312
unsigned char d_type; /* file type to prevent lstat after readdir */
13+
char d_name[MAX_PATH]; /* file name */
1414
};
1515

1616
DIR *opendir(const char *dirname);

0 commit comments

Comments
 (0)