diff options
author | Craig A. Berry <craigberry@mac.com> | 2008-10-30 18:17:04 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2008-10-30 18:17:04 +0000 |
commit | 643f470b35382516fe3dbc50a5ea42d5018d5205 (patch) | |
tree | 2582ed01d2870fed56937e8ebfcb2c5e42ac1a0f /vms | |
parent | 4148925fb9b68c2d0202035b79c78c404072c670 (diff) | |
download | perl-643f470b35382516fe3dbc50a5ea42d5018d5205.tar.gz |
Try to demangle the mess created by 34667 (the "resubmittal" was actually
not at all like the original patch I tested).
p4raw-id: //depot/perl@34668
Diffstat (limited to 'vms')
-rw-r--r-- | vms/vms.c | 122 |
1 files changed, 61 insertions, 61 deletions
@@ -13243,66 +13243,66 @@ mp_do_vms_realpath(pTHX_ const char *filespec, char *outbuf, if (haslower) __mystrtolower(rslt); } } -+ } else { -+ -+ /* Now for some hacks to deal with backwards and forward */ -+ /* compatibilty */ -+ if (!decc_efs_charset) { -+ -+ /* 1. ODS-2 mode wants to do a syntax only translation */ -+ rslt = do_rmsexpand(filespec, outbuf, -+ 0, NULL, 0, NULL, utf8_fl); -+ -+ } else { -+ if (decc_filename_unix_report) { -+ char * dir_name; -+ char * vms_dir_name; -+ char * file_name; -+ -+ /* 2. ODS-5 / UNIX report mode should return a failure */ -+ /* if the parent directory also does not exist */ -+ /* Otherwise, get the real path for the parent */ -+ /* and add the child to it. -+ -+ /* basename / dirname only available for VMS 7.0+ */ -+ /* So we may need to implement them as common routines */ -+ -+ Newx(dir_name, VMS_MAXRSS + 1, char); -+ Newx(vms_dir_name, VMS_MAXRSS + 1, char); -+ dir_name[0] = '\0'; -+ file_name = NULL; -+ -+ /* First try a VMS parse */ -+ sts = vms_split_path -+ (filespec, -+ &v_spec, -+ &v_len, -+ &r_spec, -+ &r_len, -+ &d_spec, -+ &d_len, -+ &n_spec, -+ &n_len, -+ &e_spec, -+ &e_len, -+ &vs_spec, -+ &vs_len); -+ -+ if (sts == 0) { -+ /* This is VMS */ -+ -+ int dir_len = v_len + r_len + d_len + n_len; -+ if (dir_len > 0) { -+ strncpy(dir_name, filespec, dir_len); -+ dir_name[dir_len] = '\0'; -+ file_name = (char *)&filespec[dir_len + 1]; -+ } -+ } else { -+ /* This must be UNIX */ -+ char * tchar; -+ -+ tchar = strrchr(filespec, '/'); -+ + } else { + + /* Now for some hacks to deal with backwards and forward */ + /* compatibilty */ + if (!decc_efs_charset) { + + /* 1. ODS-2 mode wants to do a syntax only translation */ + rslt = do_rmsexpand(filespec, outbuf, + 0, NULL, 0, NULL, utf8_fl); + + } else { + if (decc_filename_unix_report) { + char * dir_name; + char * vms_dir_name; + char * file_name; + + /* 2. ODS-5 / UNIX report mode should return a failure */ + /* if the parent directory also does not exist */ + /* Otherwise, get the real path for the parent */ + /* and add the child to it. + + /* basename / dirname only available for VMS 7.0+ */ + /* So we may need to implement them as common routines */ + + Newx(dir_name, VMS_MAXRSS + 1, char); + Newx(vms_dir_name, VMS_MAXRSS + 1, char); + dir_name[0] = '\0'; + file_name = NULL; + + /* First try a VMS parse */ + sts = vms_split_path + (filespec, + &v_spec, + &v_len, + &r_spec, + &r_len, + &d_spec, + &d_len, + &n_spec, + &n_len, + &e_spec, + &e_len, + &vs_spec, + &vs_len); + + if (sts == 0) { + /* This is VMS */ + + int dir_len = v_len + r_len + d_len + n_len; + if (dir_len > 0) { + strncpy(dir_name, filespec, dir_len); + dir_name[dir_len] = '\0'; + file_name = (char *)&filespec[dir_len + 1]; + } + } else { + /* This must be UNIX */ + char * tchar; + + tchar = strrchr(filespec, '/'); + if (tchar != NULL) { int dir_len = tchar - filespec; strncpy(dir_name, filespec, dir_len); @@ -13337,7 +13337,7 @@ mp_do_vms_realpath(pTHX_ const char *filespec, char *outbuf, Safefree(dir_name); } } - + } Safefree(vms_spec); } return rslt; |