From: <ea...@us...> - 2003-10-10 15:02:10
|
Update of /cvsroot/mingw/runtime/mingwex In directory sc8-pr-cvs1:/tmp/cvs-serv5626/mingwex Modified Files: dirent.c Log Message: Import winsup changes Index: dirent.c =================================================================== RCS file: /cvsroot/mingw/runtime/mingwex/dirent.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dirent.c 15 Sep 2003 14:18:35 -0000 1.3 --- dirent.c 10 Oct 2003 15:02:04 -0000 1.4 *************** *** 77,82 **** /* Allocate enough space to store DIR structure and the complete * directory path given. */ ! nd = (_TDIR *) malloc (sizeof (_TDIR) + _tcslen (szFullPath) + _tcslen (SLASH) + ! _tcslen (SUFFIX)); if (!nd) --- 77,82 ---- /* Allocate enough space to store DIR structure and the complete * directory path given. */ ! nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen(szFullPath) + _tcslen (SLASH) + ! _tcslen(SUFFIX) + 1) * sizeof(_TCHAR)); if (!nd) *************** *** 166,170 **** if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta))) { ! /* We are off the end or otherwise error. */ _findclose (dirp->dd_handle); dirp->dd_handle = -1; --- 166,175 ---- if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta))) { ! /* We are off the end or otherwise error. ! _findnext sets errno to ENOENT if no more file ! Undo this. */ ! DWORD winerr = GetLastError(); ! if (winerr == ERROR_NO_MORE_FILES) ! errno = 0; _findclose (dirp->dd_handle); dirp->dd_handle = -1; |