summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-01-28 17:05:35 -0600
committerCraig A. Berry <craigberry@mac.com>2012-01-28 17:15:18 -0600
commitbd1901c67e522749babb4c06e4343629529cdd17 (patch)
tree7f4bf3a7560fa131bb71e12030ad712a9b1d6cc0
parent21eede782bed11b0263f9bff02b9ca7b7dfcd6eb (diff)
downloadperl-bd1901c67e522749babb4c06e4343629529cdd17.tar.gz
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.
-rw-r--r--vms/vms.c82
1 files changed, 36 insertions, 46 deletions
diff --git a/vms/vms.c b/vms/vms.c
index dafb655267..2a989c8b8e 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;
}
}