]> Savannah Git Hosting - gnulib.git/commit
scandir: Fix _D_ALLOC_NAMLEN() on OS/2 kLIBC
authorKO Myung-Hun <komh78@gmail.com>
Thu, 1 Dec 2016 10:52:46 +0000 (19:52 +0900)
committerPádraig Brady <P@draigBrady.com>
Thu, 1 Dec 2016 11:36:57 +0000 (11:36 +0000)
commit2c5bbee2ce4a85a27deab6e68102557d831c6d0f
treec3079b07d6a8f2a85f18a9a15e76a3a85ea61dfc
parent44686d94aefa095d0a4a6bf0f88a6a05c2e7e657
scandir: Fix _D_ALLOC_NAMLEN() on OS/2 kLIBC

On OS/2 kLIBC, d_name is not the last field of struct dirent. So
copying struct dirent according to the size calculated based on d_name
blows the fields after d_name up.

The correct way is to allocate the whole size of struct dirent.

* lib/scandir.c (_D_ALLOC_NAMLEN): Consider the fields after d_name on
OS/2 kLIBC.
ChangeLog
lib/scandir.c