File: solarispatch

package info (click to toggle)
bibview 2.2-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,252 kB
  • ctags: 1,588
  • sloc: ansic: 15,149; yacc: 1,145; makefile: 297; lex: 221; sh: 17
file content (33 lines) | stat: -rw-r--r-- 1,331 bytes parent folder | download | duplicates (3)
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 );