summaryrefslogtreecommitdiff
path: root/vms/vms.c
diff options
context:
space:
mode:
authorJohn Malmberg <wb8tyw@gmail.com>2009-02-09 08:50:29 -0600
committerCraig A. Berry <craigberry@mac.com>2009-02-11 08:14:54 -0600
commitbf8d1304d513f823735f8a2983c62ad285a21568 (patch)
treee76d9990cba364293e69674623417cb2adef7579 /vms/vms.c
parent8098e75c0be3e52e094306bfbb7c5350f543ee96 (diff)
downloadperl-bf8d1304d513f823735f8a2983c62ad285a21568.tar.gz
vms fgetname wrapper.
fgetname() does not always return the correct Unix format file specification when the decc$filename_unix_report feature is active and is ignoring the decc$readdir_dropdot_notype setting. So always have fgetname() return a VMS format file specification. When decc$filename_unix_report is active, use unixify() to convert it to the expected syntax. This bug shows up doing rename tests on an open file that has no file extension with decc$filename_unix_report and decc$readdir_dropdot_notype both active. Message-ID: <499042B5.4030803@gmail.com>
Diffstat (limited to 'vms/vms.c')
-rw-r--r--vms/vms.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 7d208ba819..b970bf7dff 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -9397,7 +9397,7 @@ mp_getredirection(pTHX_ int *ac, char ***av)
/* Input from a pipe, reopen it in binary mode to disable */
/* carriage control processing. */
- fgetname(stdin, mbxname);
+ fgetname(stdin, mbxname, 1);
mbxnam.dsc$a_pointer = mbxname;
mbxnam.dsc$w_length = strlen(mbxnam.dsc$a_pointer);
lib$getdvi(&dvi_item, 0, &mbxnam, &bufsize, 0, 0);
@@ -11328,6 +11328,34 @@ Perl_my_flush(pTHX_ FILE *fp)
}
/*}}}*/
+/* fgetname() is not returning the correct file specifications when
+ * decc_filename_unix_report mode is active. So we have to have it
+ * aways return filenames in VMS mode and convert it ourselves.
+ */
+
+/*{{{ char * my_fgetname(FILE *fp, buf)*/
+char *
+Perl_my_fgetname(FILE *fp, char * buf) {
+ char * retname;
+ char * vms_name;
+
+ retname = fgetname(fp, buf, 1);
+
+ /* If we are in VMS mode, then we are done */
+ if (!decc_filename_unix_report || (retname == NULL)) {
+ return retname;
+ }
+
+ /* Convert this to Unix format */
+ vms_name = PerlMem_malloc(VMS_MAXRSS + 1);
+ strcpy(vms_name, retname);
+ retname = int_tounixspec(vms_name, buf, NULL);
+ PerlMem_free(vms_name);
+
+ return retname;
+}
+/*}}}*/
+
/*
* Here are replacements for the following Unix routines in the VMS environment:
* getpwuid Get information for a particular UIC or UID