49
49
* GLOB_NOMAGIC:
50
50
* Same as GLOB_NOCHECK, but it will only append pattern if it did
51
51
* not contain any magic characters. [Used in csh style globbing]
52
- * GLOB_ALTDIRFUNC:
53
- * Use alternately specified directory access functions.
54
52
* GLOB_TILDE:
55
53
* expand ~user/foo to the /home/dir/of/user/foo
56
54
* GLOB_BRACE:
@@ -560,14 +558,6 @@ static int glob3(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend
560
558
DIR * dirp ;
561
559
int err ;
562
560
563
- /*
564
- * The readdirfunc declaration can't be prototyped, because it is
565
- * assigned, below, to two functions which are prototyped in glob.h
566
- * and dirent.h as taking pointers to differently typed opaque
567
- * structures.
568
- */
569
- struct dirent * (* readdirfunc )();
570
-
571
561
if (pathend > pathend_last )
572
562
return (1 );
573
563
* pathend = EOS ;
@@ -589,11 +579,7 @@ static int glob3(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend
589
579
err = 0 ;
590
580
591
581
/* Search directory for matching names. */
592
- if (pglob -> gl_flags & GLOB_ALTDIRFUNC )
593
- readdirfunc = pglob -> gl_readdir ;
594
- else
595
- readdirfunc = readdir ;
596
- while ((dp = (* readdirfunc )(dirp ))) {
582
+ while ((dp = readdir (dirp ))) {
597
583
register uint8_t * sc ;
598
584
register Char * dc ;
599
585
@@ -620,10 +606,7 @@ static int glob3(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend
620
606
break ;
621
607
}
622
608
623
- if (pglob -> gl_flags & GLOB_ALTDIRFUNC )
624
- (* pglob -> gl_closedir )(dirp );
625
- else
626
- closedir (dirp );
609
+ closedir (dirp );
627
610
return (err );
628
611
}
629
612
@@ -777,9 +760,6 @@ static DIR * g_opendir(Char *str, glob_t *pglob)
777
760
return (NULL );
778
761
}
779
762
780
- if (pglob -> gl_flags & GLOB_ALTDIRFUNC )
781
- return ((* pglob -> gl_opendir )(buf ));
782
-
783
763
return (opendir (buf ));
784
764
}
785
765
@@ -789,8 +769,6 @@ static int g_lstat(Char *fn, php_win32_ioutil_stat_t *sb, glob_t *pglob)
789
769
790
770
if (g_Ctoc (fn , buf , sizeof (buf )))
791
771
return (-1 );
792
- if (pglob -> gl_flags & GLOB_ALTDIRFUNC )
793
- return ((* pglob -> gl_lstat )(buf , sb ));
794
772
return (php_win32_ioutil_lstat (buf , sb ));
795
773
}
796
774
@@ -800,8 +778,6 @@ static int g_stat(Char *fn, php_win32_ioutil_stat_t *sb, glob_t *pglob)
800
778
801
779
if (g_Ctoc (fn , buf , sizeof (buf )))
802
780
return (-1 );
803
- if (pglob -> gl_flags & GLOB_ALTDIRFUNC )
804
- return ((* pglob -> gl_stat )(buf , sb ));
805
781
return (php_win32_ioutil_stat (buf , sb ));
806
782
}
807
783
0 commit comments