The attached patch seems to take care of the cases where File::Find gets
lost when changing directories to a directory name that collides with a
logical name. I get a successful build and test of 5.8.1 RC2 even, for
example, with a SITE_PERL logical name in my system table. In an
unrelated matter the patch also corrects the assumption that the .dir
extension indicating a VMS directory name will always appear in lower case.

I thought I'd give vmsperl folks a chance to kick the tires on this one
before submitting to p5p. Peter, does this correct the problems you've
been having?



--- lib/File/Find.pm;-0 Sun May 18 04:03:15 2003
+++ lib/File/Find.pm    Fri Jul 18 14:34:46 2003
@@ -668,7 +668,7 @@
                next Proc_Top_Item;
            }
            if (-d _) {
-               $top_item =~ s/\.dir\z// if $Is_VMS;
+               $top_item =~ s/\.dir\z//i if $Is_VMS;
                _find_dir($wanted, $top_item, $topnlink);
                $Is_Dir= 1;
            }
@@ -769,7 +769,7 @@
                }
            }
        }
-       unless (chdir $udir) {
+       unless (chdir ($^O eq 'VMS' && $udir !~ /\// ? "./$udir" : $udir)) {
            warnings::warnif "Can't cd to $udir: $!\n";
            return;
        }
@@ -811,7 +811,7 @@
                    }
                }
            }
-           unless (chdir $udir) {
+           unless (chdir ($^O eq 'VMS' && $udir !~ /\// ? "./$udir" : $udir)) {
                if ($Is_MacOS) {
                    warnings::warnif "Can't cd to ($p_dir) $udir: $!\n";
                }
@@ -876,7 +876,7 @@
 
                    if (-d _) {
                        --$subcount;
-                       $FN =~ s/\.dir\z// if $Is_VMS;
+                       $FN =~ s/\.dir\z//i if $Is_VMS;
                        # HACK: replace push to preserve dir traversal order
                        #push @Stack,[$CdLvl,$dir_name,$FN,$sub_nlink];
                        splice @Stack, $stack_top, 0,

Reply via email to