1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
*** FileNom.c Mon Feb 27 15:03:49 1995
--- FileNom.sol.c Mon Feb 27 14:49:42 1995
***************
*** 844,858 ****
/* Read the directory a first time, to get */
/* the number `num' of entries and to allocate namedir. */
num = 0;
! while ( (direntp = readdir(dirp)) != NULL ) num++;
namelist = (struct dirent **)XtMalloc( (num+1)*sizeof(struct dirent *));
num = 0;
rewinddir( dirp );
while ( TRUE ) {
! if ( (direntp = readdir(dirp)) == NULL ) break;
! namelist[num] = (struct dirent *) XtMalloc(direntp_size);
! bcopy(direntp, namelist[num], direntp_size);
! num++;
direntp = (struct dirent *)XtMalloc( direntp_size );
}
XtFree( (char *)direntp );
--- 844,856 ----
/* Read the directory a first time, to get */
/* the number `num' of entries and to allocate namedir. */
num = 0;
! while ( readdir_r( dirp, direntp) != NULL ) num++;
namelist = (struct dirent **)XtMalloc( (num+1)*sizeof(struct dirent *));
num = 0;
rewinddir( dirp );
while ( TRUE ) {
! if ( readdir_r(dirp, direntp ) == NULL ) break;
! namelist[num] = direntp;
direntp = (struct dirent *)XtMalloc( direntp_size );
}
XtFree( (char *)direntp );
|