pear patch (WAS Re: [PEAR-DEV] File_Find patch)
| From: | Chandrashekhar Bhosle | Date: | Sat, 28 Dec 2002 14:57:30 +0000 |
| Subject: | pear patch (WAS Re: [PEAR-DEV] File_Find patch) | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11879@lists.php.net to get a copy of this message | ||
On Sat, 28 Dec 2002 08:45:44 -0500
Sterling Hughes <sterling@bumblebury.com> wrote:
> Commited, thanks.
> > 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)
Just read your CVS commit message. I hadn't figured out
"why" either when I submitted the patch. I just realised
the first entry in the directory is a dir called "0".
Therefore while (0) { ... and we're out of the loop :)
I noticed some other packages in pear had similar usage
and I didn't want to waste time by running into this
problem again so I've written this patch
http://freedomink.org/code/php/patches/pear.patch
which fixes the following packages.
- cnb
$ grep -r "while.*readdir" * | grep -v -i false
Archive_Tar/Archive/Tar.php: while ($p_hitem = readdir($p_hdir)) {
Cache/Container/file.php: while ($file = readdir($dh)) {
Cache/Container/file.php: while ($file = readdir($dh)) {
Cache_Lite/Lite.php: while ($file = readdir($dh)) {
File_SearchReplace/SearchReplace.php: while ($file = readdir($dh)) {
Forum/lib/plugins/plugin.php: while($plugin = readdir($dir)) {
HTML_Menu/MenuBrowser.php: while ($file = readdir($dh)) {
HTTP_WebDAV_Server/HTTP_WebDAV_Server_file.php: while ($filename = readdir($handle)) {
PECL/smbc/tests/001.phpt:while($file = smbc_readdir($fd)){
PECL/smbc/tests/002.phpt:while($file = smbc_readdir($fd)){
PHPDoc/filehandler/PhpdocFileHandler.php: while ($file = readdir($dh)) {