Change 31331 by [EMAIL PROTECTED] on 2007/06/03 22:26:20

        cando_by_name again: work harder to identify directories 
        for fileification, plus a nit missed in #31326.

Affected files ...

... //depot/perl/vms/vms.c#197 edit

Differences ...

==== //depot/perl/vms/vms.c#197 (text) ====
Index: perl/vms/vms.c
--- perl/vms/vms.c#196~31326~   2007-06-02 09:02:03.000000000 -0700
+++ perl/vms/vms.c      2007-06-03 15:26:20.000000000 -0700
@@ -10937,6 +10937,7 @@
   struct itmlst_3 usrprolst[2] = {{sizeof curprv, CHP$_PRIV, &curprv, &retlen},
          {0,0,0,0}};
   struct dsc$descriptor_s usrprodsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
+  Stat_t st;
   static int profile_context = -1;
 
   if (!fname || !*fname) return FALSE;
@@ -10968,12 +10969,16 @@
     strcpy(vmsname,fname);
   }
 
-  /* sys$check_access needs a file spec, not a directory spec */
+  /* sys$check_access needs a file spec, not a directory spec.
+   * Don't use flex_stat here, as that depends on thread context
+   * having been initialized, and we may get here during startup.
+   */
 
   retlen = namdsc.dsc$w_length = strlen(vmsname);
   if (vmsname[retlen-1] == ']' 
       || vmsname[retlen-1] == '>' 
-      || vmsname[retlen-1] == ':') {
+      || vmsname[retlen-1] == ':'
+      || (!stat(vmsname, (stat_t *)&st) && S_ISDIR(st.st_mode))) {
 
       if (!do_fileify_dirspec(vmsname,fileified,1,NULL)) {
         PerlMem_free(fileified);
@@ -10982,6 +10987,9 @@
       }
       fname = fileified;
   }
+  else {
+      fname = vmsname;
+  }
 
   retlen = namdsc.dsc$w_length = strlen(fname);
   namdsc.dsc$a_pointer = (char *)fname;
End of Patch.

Reply via email to