summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/dirent.c
diff options
context:
space:
mode:
authorEarnie Boyd <earnie@users.sf.net>2003-06-18 13:54:47 +0000
committerEarnie Boyd <earnie@users.sf.net>2003-06-18 13:54:47 +0000
commit2302957c535e3507b5c8920ab93c3dea7bf82f4a (patch)
treee0c2db3abe41b5ea1da8bd3fa20b3bfcdf3745da /winsup/mingw/mingwex/dirent.c
parent1c906df21f516f84d9427d0d15205bbc7aac7f2d (diff)
downloadcygnal-2302957c535e3507b5c8920ab93c3dea7bf82f4a.tar.gz
cygnal-2302957c535e3507b5c8920ab93c3dea7bf82f4a.tar.bz2
cygnal-2302957c535e3507b5c8920ab93c3dea7bf82f4a.zip
* include/dirent.h (dirent): Make d_name and array instead of a pointer.
* mingwex/dirent.c: Modifications througout to fill d_name array. * Makefile.in (LIBS): Add new MSVCRT libraries libmsvcr70 and libmsvcr71, including debug versions. (msvcr70.def, msvcr70d.def, msvcr71.def, msvcr71.def): New targets.
Diffstat (limited to 'winsup/mingw/mingwex/dirent.c')
-rw-r--r--winsup/mingw/mingwex/dirent.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c
index cdca6de35..20d1921d7 100644
--- a/winsup/mingw/mingwex/dirent.c
+++ b/winsup/mingw/mingwex/dirent.c
@@ -113,7 +113,7 @@ _topendir (const _TCHAR *szPath)
nd->dd_dir.d_ino = 0;
nd->dd_dir.d_reclen = 0;
nd->dd_dir.d_namlen = 0;
- nd->dd_dir.d_name = nd->dd_dta.name;
+ memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
return nd;
}
@@ -137,13 +137,6 @@ _treaddir (_TDIR * dirp)
return (struct _tdirent *) 0;
}
- if (dirp->dd_dir.d_name != dirp->dd_dta.name)
- {
- /* The structure does not seem to be set up correctly. */
- errno = EINVAL;
- return (struct _tdirent *) 0;
- }
-
if (dirp->dd_stat < 0)
{
/* We have already returned all files in the directory
@@ -190,7 +183,8 @@ _treaddir (_TDIR * dirp)
/* Successfully got an entry. Everything about the file is
* already appropriately filled in except the length of the
* file name. */
- dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dir.d_name);
+ dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name);
+ _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
return &dirp->dd_dir;
}