Re: File_Find patch

From: Date: Sat, 28 Dec 2002 13:45:44 +0000
Subject: Re: File_Find patch
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11875@lists.php.net to get a copy of this message
Commited, thanks. -Sterling > > Hi, > > Tiny patch to compare readdir() return value using !== > in File_Find. Only checking if ($file = readdir($dir)) > doesn't seem to work for some dir paths (specifically /var/qmail/queue/remote of qmail > installations) > > - cnb > > > --- Find.orig.php 2002-12-28 14:06:40.000000000 +0530 > +++ Find.php 2002-12-28 14:03:09.000000000 +0530 > @@ -78,7 +78,7 @@ > > $match_function = File_Find::_determineRegex($pattern, $pattern_type); > $matches = array(); > - while ($entry = @readdir ($dh)) { > + while (false !== ($entry = @readdir ($dh)) { > if ($match_function($pattern, $entry) && > $entry != '.' && > $entry != '..') { > @@ -150,7 +150,7 @@ > > $directory .= DIRECTORY_SEPARATOR; > $dh=opendir($directory); > - while ($entry = readdir($dh)) { > + while (false !== ($entry = readdir($dh)) { > if ($entry != "." && $entry != "..") { > array_push($retval, $entry); > } > @@ -246,7 +246,7 @@ > return $pe; > } > > - while ($entry = @readdir($dh)) { > + while (false !== ($entry = @readdir($dh)) { > if ($entry != '.' && > $entry != '..') { > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.pear.dev (#11875) next »