* dirent.c (opendir): Convert given pathname to
absolute pathname.
This commit is contained in:
parent
9b15f5fa95
commit
e9f1cbd011
|
@ -1,3 +1,8 @@
|
|||
2002-04-18 Pascal Obry <obry@gnat.com>
|
||||
|
||||
* dirent.c (opendir): Convert given pathname to
|
||||
absolute pathname.
|
||||
|
||||
2002-04-09 Earnie Boyd <earnie@users.sf.net>
|
||||
|
||||
* include/_mingw.h: Increment version.
|
||||
|
|
|
@ -40,6 +40,7 @@ opendir (const char *szPath)
|
|||
{
|
||||
DIR *nd;
|
||||
unsigned int rc;
|
||||
char szFullPath[MAX_PATH];
|
||||
|
||||
errno = 0;
|
||||
|
||||
|
@ -70,9 +71,12 @@ opendir (const char *szPath)
|
|||
return (DIR *) 0;
|
||||
}
|
||||
|
||||
/* Make an absolute pathname. */
|
||||
_fullpath (szFullPath, szPath, MAX_PATH);
|
||||
|
||||
/* Allocate enough space to store DIR structure and the complete
|
||||
* directory path given. */
|
||||
nd = (DIR *) malloc (sizeof (DIR) + strlen (szPath) + strlen (SLASH) +
|
||||
nd = (DIR *) malloc (sizeof (DIR) + strlen (szFullPath) + strlen (SLASH) +
|
||||
strlen (SUFFIX));
|
||||
|
||||
if (!nd)
|
||||
|
@ -83,7 +87,7 @@ opendir (const char *szPath)
|
|||
}
|
||||
|
||||
/* Create the search expression. */
|
||||
strcpy (nd->dd_name, szPath);
|
||||
strcpy (nd->dd_name, szFullPath);
|
||||
|
||||
/* Add on a slash if the path does not end with one. */
|
||||
if (nd->dd_name[0] != '\0' &&
|
||||
|
|
Loading…
Reference in New Issue