aboutsummaryrefslogtreecommitdiff
path: root/winsup/mingw
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
parent1c906df21f516f84d9427d0d15205bbc7aac7f2d (diff)
downloadnewlib-2302957c535e3507b5c8920ab93c3dea7bf82f4a.zip
newlib-2302957c535e3507b5c8920ab93c3dea7bf82f4a.tar.gz
newlib-2302957c535e3507b5c8920ab93c3dea7bf82f4a.tar.bz2
* 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')
-rw-r--r--winsup/mingw/Makefile.in16
-rw-r--r--winsup/mingw/include/dirent.h6
-rw-r--r--winsup/mingw/mingwex/dirent.c12
3 files changed, 18 insertions, 16 deletions
diff --git a/winsup/mingw/Makefile.in b/winsup/mingw/Makefile.in
index 0404d84..dd7a951 100644
--- a/winsup/mingw/Makefile.in
+++ b/winsup/mingw/Makefile.in
@@ -157,8 +157,15 @@ MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \
MOLD_OBJS = isascii.o iscsym.o iscsymf.o toascii.o \
strcasecmp.o strncasecmp.o wcscmpi.o
-LIBS = libcrtdll.a libmsvcrt.a libmsvcrtd.a libmingw32.a \
- libcoldname.a libmoldname.a libmoldnamed.a $(LIBM_A) libmingwthrd.a
+LIBS = libcrtdll.a \
+ libmsvcrt.a libmsvcrtd.a \
+ libmsvcr70.a libmsvcr70d.a \
+ libmsvcr71.a libmsvcr71d.a \
+ libmingw32.a \
+ libcoldname.a \
+ libmoldname.a libmoldnamed.a \
+ $(LIBM_A) \
+ libmingwthrd.a
DLLS = $(THREAD_DLL_NAME)
@@ -234,7 +241,10 @@ libmingw32.a: $(MINGW_OBJS)
$(AR) rc $@ $(MINGW_OBJS)
$(RANLIB) $@
-msvcrt.def msvcrtd.def: msvcrt.def.in
+msvcrt.def msvcrtd.def \
+msvcr70.def msvcr70d.def \
+msvcr71.def msvcr71d.def \
+: msvcrt.def.in
$(CC) -DRUNTIME=$(basename $(notdir $@)) \
-D__FILENAME__=$@ \
-D__MSVCRT__ -C -E -P \
diff --git a/winsup/mingw/include/dirent.h b/winsup/mingw/include/dirent.h
index 5a9246a..4e787d8 100644
--- a/winsup/mingw/include/dirent.h
+++ b/winsup/mingw/include/dirent.h
@@ -42,9 +42,7 @@ struct dirent
long d_ino; /* Always zero. */
unsigned short d_reclen; /* Always zero. */
unsigned short d_namlen; /* Length of name in d_name. */
- char* d_name; /* File name. */
- /* NOTE: The name in the dirent structure points to the name in the
- * finddata_t structure in the DIR. */
+ char d_name[FILENAME_MAX]; /* File name. */
};
/*
@@ -92,7 +90,7 @@ struct _wdirent
long d_ino; /* Always zero. */
unsigned short d_reclen; /* Always zero. */
unsigned short d_namlen; /* Length of name in d_name. */
- wchar_t* d_name; /* File name. */
+ wchar_t d_name[FILENAME_MAX]; /* File name. */
/* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
};
diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c
index cdca6de..20d1921 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;
}