diff options
author | Charles Bailey <bailey@newman.upenn.edu> | 1999-08-23 03:10:41 +0000 |
---|---|---|
committer | bailey <bailey@newman.upenn.edu> | 1999-08-23 03:10:41 +0000 |
commit | 9394834148e0e1f4a127d31d16d5fb6c66ffadd1 (patch) | |
tree | 28651257e72f81b9909e2f314542ce24b91338ed | |
parent | 5c84aa53566d8965295f36b803494e6ff74341bd (diff) | |
download | perl-9394834148e0e1f4a127d31d16d5fb6c66ffadd1.tar.gz |
Allow option to treat barewords at start of Unix paths as simple words rather than logicals
p4raw-id: //depot/vmsperl@4020
-rw-r--r-- | vms/vms.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -2,8 +2,8 @@ * * VMS-specific routines for perl5 * - * Last revised: 24-Apr-1999 by Charles Bailey bailey@newman.upenn.edu - * Version: 5.5.58 + * Last revised: 15-Aug-1999 by Charles Bailey bailey@newman.upenn.edu + * Version: 5.5.60 */ #include <acedef.h> @@ -91,6 +91,10 @@ static struct dsc$descriptor_s *defenv[] = { &fildevdsc, &crtlenvdsc, NULL }; static struct dsc$descriptor_s **env_tables = defenv; static bool will_taint = FALSE; /* tainting active, but no PL_curinterp yet */ +/* True if we shouldn't treat barewords as logicals during directory */ +/* munching */ +static int no_translate_barewords; + /*{{{int vmstrnenv(const char *lnm, char *eqv, unsigned long int idx, struct dsc$descriptor_s **tabvec, unsigned long int flags) */ int vmstrnenv(const char *lnm, char *eqv, unsigned long int idx, @@ -1721,7 +1725,8 @@ static char *do_pathify_dirspec(char *dir,char *buf, int ts) if (*dir) strcpy(trndir,dir); else getcwd(trndir,sizeof trndir - 1); - while (!strpbrk(trndir,"/]:>") && my_trnlnm(trndir,trndir,0)) { + while (!strpbrk(trndir,"/]:>") && !no_translate_barewords + && my_trnlnm(trndir,trndir,0)) { STRLEN trnlen = strlen(trndir); /* Trap simple rooted lnms, and return lnm:[000000] */ @@ -3576,7 +3581,7 @@ int my_flush(FILE *fp) { int res; - if ((res = fflush(fp)) == 0) { + if ((res = fflush(fp)) == 0 && fp) { #ifdef VMS_DO_SOCKETS Stat_t s; if (Fstat(fileno(fp), &s) == 0 && !S_ISSOCK(s.st_mode)) @@ -5029,6 +5034,13 @@ void init_os_extras() { char* file = __FILE__; + dTHX; + char temp_buff[512]; + if (my_trnlnm("DECC$DISABLE_TO_VMS_LOGNAME_TRANSLATION", temp_buff, 0)) { + no_translate_barewords = TRUE; + } else { + no_translate_barewords = FALSE; + } newXSproto("VMS::Filespec::rmsexpand",rmsexpand_fromperl,file,"$;$"); newXSproto("VMS::Filespec::vmsify",vmsify_fromperl,file,"$"); |