In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bd1901c67e522749babb4c06e4343629529cdd17?hp=21eede782bed11b0263f9bff02b9ca7b7dfcd6eb>

- Log -----------------------------------------------------------------
commit bd1901c67e522749babb4c06e4343629529cdd17
Author: Craig A. Berry <[email protected]>
Date:   Sat Jan 28 17:05:35 2012 -0600

    Trim directory extension in pathify under EFS.
    
    When Extened Filename Syntax (EFS) is in effect, 1fe570cc5e24ee
    changed the age-old behavior of trimming the directory extension
    off a directory filename when the path is in Unix syntax.  EFS
    really has nothing to do with the necessity to trim .DIR;1 from
    the name, so remove the conditional check for EFS from the
    existing code.
    
    This gets three more tests passing under EFS in vms/ext/filespec.t.
-----------------------------------------------------------------------

Summary of changes:
 vms/vms.c |   82 ++++++++++++++++++++++++++----------------------------------
 1 files changed, 36 insertions(+), 46 deletions(-)

diff --git a/vms/vms.c b/vms/vms.c
index dafb655..2a989c8 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -6692,61 +6692,51 @@ static char *int_pathify_dirspec(const char *dir, char 
*buf)
         return ret_spec;
 
     } else {
-        /* Unix specification, Could be trivial conversion */
-        STRLEN dir_len;
-        dir_len = strlen(trndir);
+        /* Unix specification, Could be trivial conversion, */
+        /* but have to deal with trailing '.dir' or extra '.' */
 
-        /* If the extended file character set is in effect */
-        /* then pathify is simple */
-
-        if (!decc_efs_charset) {
-            /* Have to deal with trailing '.dir' or extra '.' */
-            /* that should not be there in legacy mode, but is */
-
-            char * lastdot;
-            char * lastslash;
-            int is_dir;
-
-            lastslash = strrchr(trndir, '/');
-            if (lastslash == NULL)
-                lastslash = trndir;
-            else
-                lastslash++;
-
-            lastdot = NULL;
+        char * lastdot;
+        char * lastslash;
+        int is_dir;
+        STRLEN dir_len = strlen(trndir);
 
-            /* '..' or '.' are valid directory components */
-            is_dir = 0;
-            if (lastslash[0] == '.') {
-                if (lastslash[1] == '\0') {
-                   is_dir = 1;
-                } else if (lastslash[1] == '.') {
-                    if (lastslash[2] == '\0') {
+        lastslash = strrchr(trndir, '/');
+        if (lastslash == NULL)
+            lastslash = trndir;
+        else
+            lastslash++;
+
+        lastdot = NULL;
+
+        /* '..' or '.' are valid directory components */
+        is_dir = 0;
+        if (lastslash[0] == '.') {
+            if (lastslash[1] == '\0') {
+               is_dir = 1;
+            } else if (lastslash[1] == '.') {
+                if (lastslash[2] == '\0') {
+                    is_dir = 1;
+                } else {
+                    /* And finally allow '...' */
+                    if ((lastslash[2] == '.') && (lastslash[3] == '\0')) {
                         is_dir = 1;
-                    } else {
-                        /* And finally allow '...' */
-                        if ((lastslash[2] == '.') && (lastslash[3] == '\0')) {
-                            is_dir = 1;
-                        }
                     }
                 }
             }
+        }
 
-            if (!is_dir) {
-               lastdot = strrchr(lastslash, '.');
-            }
-            if (lastdot != NULL) {
-                STRLEN e_len;
-
-                /* '.dir' is discarded, and any other '.' is invalid */
-                e_len = strlen(lastdot);
-
-                is_dir = is_dir_ext(lastdot, e_len, NULL, 0);
+        if (!is_dir) {
+           lastdot = strrchr(lastslash, '.');
+        }
+        if (lastdot != NULL) {
+            STRLEN e_len;
+             /* '.dir' is discarded, and any other '.' is invalid */
+            e_len = strlen(lastdot);
 
-                if (is_dir) {
-                    dir_len = dir_len - 4;
+            is_dir = is_dir_ext(lastdot, e_len, NULL, 0);
 
-                }
+            if (is_dir) {
+                dir_len = dir_len - 4;
             }
         }
 

--
Perl5 Master Repository

Reply via email to