git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] Win32 dirent: change FILENAME_MAX to MAX_PATH

From
Stepan Kasal <kasal@ucw.cz>
Date
Jun 6, 2014, 13:43 UTC
Message-ID
<1402062201-9709-4-git-send-email-kasal@ucw.cz>
In-Reply-To
<1402062201-9709-1-git-send-email-kasal@ucw.cz>
From: Karsten Blees <blees@dcon.de>

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 <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 compat/win32/dirent.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/win32/dirent.h b/compat/win32/dirent.h
index 7f4e6c7..8838cd6 100644
--- a/compat/win32/dirent.h
+++ b/compat/win32/dirent.h
@@ -9,8 +9,8 @@ typedef struct DIR DIR;
 #define DT_LNK     3
 
 struct dirent {
-	char d_name[FILENAME_MAX];       /* File name. */
 	unsigned char d_type;      /* file type to prevent lstat after readdir */
+	char d_name[MAX_PATH];     /* file name */
 };
 
 DIR *opendir(const char *dirname);
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Previous: Stepan KasalNext: Stepan Kasal
Message 4 of 13 in “Windows dirent patches”
  1. 0/5 Windows dirent patchesStepan Kasal, Jun 6, 2014
  2. 1/5 Win32 dirent: remove unused dirent.d_ino memberStepan Kasal, Jun 6, 2014
  3. 2/5 Win32 dirent: remove unused dirent.d_reclen memberStepan Kasal, Jun 6, 2014
  4. 3/5 Win32 dirent: change FILENAME_MAX to MAX_PATHStepan Kasal, Jun 6, 2014
  5. 4/5 Win32 dirent: clarify #include directivesStepan Kasal, Jun 6, 2014
  6. 5/5 Win32 dirent: improve dirent implementationStepan Kasal, Jun 6, 2014
  7. Karsten BleesJun 6, 2014
  8. 0/5 Windows dirent patchesStepan Kasal, Jun 6, 2014
  9. 1/5 Win32 dirent: remove unused dirent.d_ino memberStepan Kasal, Jun 6, 2014
  10. 2/5 Win32 dirent: remove unused dirent.d_reclen memberStepan Kasal, Jun 6, 2014
  11. 3/5 Win32 dirent: change FILENAME_MAX to MAX_PATHStepan Kasal, Jun 6, 2014
  12. 4/5 Win32 dirent: clarify #include directivesStepan Kasal, Jun 6, 2014
  13. 5/5 Win32 dirent: improve dirent implementationStepan Kasal, Jun 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.