Change 34901 by [EMAIL PROTECTED] on 2008/11/24 04:49:44

        Subject: [EMAIL PROTECTED] vms readdir() fixes for UNIX/EFS mode
        From: "John E. Malmberg" <[EMAIL PROTECTED]>
        Date: Sat, 22 Nov 2008 11:31:58 -0600
        Message-id: <[EMAIL PROTECTED]>

Affected files ...

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

Differences ...

==== //depot/perl/vms/vms.c#235 (text) ====
Index: perl/vms/vms.c
--- perl/vms/vms.c#234~34790~   2008-11-10 04:49:23.000000000 -0800
+++ perl/vms/vms.c      2008-11-23 20:49:44.000000000 -0800
@@ -9631,11 +9631,32 @@
        &vs_spec,
        &vs_len);
 
-    /* Drop NULL extensions on UNIX file specification */
-    if ((dd->flags & PERL_VMSDIR_M_UNIXSPECS &&
-       (e_len == 1) && decc_readdir_dropdotnotype)) {
-       e_len = 0;
-       e_spec[0] = '\0';
+    if (dd->flags & PERL_VMSDIR_M_UNIXSPECS) {
+
+        /* In Unix report mode, remove the ".dir;1" from the name */
+        /* if it is a real directory. */
+        if (decc_filename_unix_report || decc_efs_charset) {
+            if ((e_len == 4) && (vs_len == 2) && (vs_spec[1] == '1')) {
+                if ((toupper(e_spec[1]) == 'D') &&
+                    (toupper(e_spec[2]) == 'I') &&
+                    (toupper(e_spec[3]) == 'R')) {
+                    Stat_t statbuf;
+                    int ret_sts;
+
+                    ret_sts = stat(buff, (stat_t *)&statbuf);
+                    if ((ret_sts == 0) && S_ISDIR(statbuf.st_mode)) {
+                        e_len = 0;
+                        e_spec[0] = 0;
+                    }
+                }
+            }
+        }
+
+        /* Drop NULL extensions on UNIX file specification */
+       if ((e_len == 1) && decc_readdir_dropdotnotype) {
+           e_len = 0;
+           e_spec[0] = '\0';
+        }
     }
 
     strncpy(dd->entry.d_name, n_spec, n_len + e_len);
End of Patch.

Reply via email to