In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/6e2e048be95a027035f83c0f673f8de94e013c87?hp=12cc68332009883c2ff280c630d124c9c065a107>

- Log -----------------------------------------------------------------
commit 6e2e048be95a027035f83c0f673f8de94e013c87
Author: Craig A. Berry <[email protected]>
Date:   Sat Mar 8 18:35:49 2014 -0600

    Handle "no versions" feature in fileify and tovmsspec.
    
    This is a follow-up to d5e61aaf9d7051b136, where we stopped
    escaping semicolons in tovmsspec when they appeared to be the
    beginning of a version specification but always escaped them
    otherwise.
    
    It turns out there is yet another CRTL feature logical name
    (DECC$FILENAME_UNIX_NO_VERSION) that tells us a Unix-format
    specification is not allowed to have a version number, so in
    that case, always escape the semicolon since it can't be the
    start of a version specification.
    
    Also, don't add the version number when fileifying directory
    specs if this "no versions" feature is in effect.
-----------------------------------------------------------------------

Summary of changes:
 vms/vms.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/vms/vms.c b/vms/vms.c
index b94d293..324cfa1 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -6130,9 +6130,11 @@ int_fileify_dirspec(const char *dir, char *buf, int 
*utf8_fl)
       /* We've picked up everything up to the directory file name.
          Now just add the type and version, and we're set. */
       if ((!decc_efs_case_preserve) && vms_process_case_tolerant)
-          strcat(buf,".dir;1");
+          strcat(buf,".dir");
       else
-          strcat(buf,".DIR;1");
+          strcat(buf,".DIR");
+      if (!decc_filename_unix_no_version)
+          strcat(buf,";1");
       PerlMem_free(trndir);
       PerlMem_free(vmsdir);
       return buf;
@@ -8298,7 +8300,6 @@ static char *int_tovmsspec
   int no_type_seen;
   char * v_spec, * r_spec, * d_spec, * n_spec, * e_spec, * vs_spec;
   int sts, v_len, r_len, d_len, n_len, e_len, vs_len;
-  size_t all_nums;
 
   if (vms_debug_fileify) {
       if (path == NULL)
@@ -8705,12 +8706,17 @@ static char *int_tovmsspec
        break;
     case ';':
         /* If it doesn't look like the beginning of a version number,
+         * or we've been promised there are no version numbers, then
          * escape it.
          */
-       all_nums = strspn(cp2+1, "0123456789");
-       if (all_nums > 5 || *(cp2 + all_nums + 1) != '\0') {
+       if (decc_filename_unix_no_version) {
          *(cp1++) = '^';
        }
+       else {
+         size_t all_nums = strspn(cp2+1, "0123456789");
+         if (all_nums > 5 || *(cp2 + all_nums + 1) != '\0')
+           *(cp1++) = '^';
+       }
        *(cp1++) = *(cp2++);
        break;
     default:

--
Perl5 Master Repository

Reply via email to