From: Craig A. Berry Date: Fri, 15 Jun 2007 03:19:46 +0000 (+0000) Subject: Don't let the home-grown readdir() on VMS return results with X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a096370a74e810dad2fc069cd86600e0bfb428a9;p=p5sagit%2Fp5-mst-13.2.git Don't let the home-grown readdir() on VMS return results with ODS-5 escapes (i.e., report foo.tar.gz, not foo^.tar.gz). p4raw-id: //depot/perl@31385 --- diff --git a/vms/vms.c b/vms/vms.c index f9aa9a3..aaaa869 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -8759,9 +8759,6 @@ Perl_opendir(pTHX_ const char *name) DIR *dd; char *dir; Stat_t sb; - int unix_flag = 0; - - unix_flag = is_unix_filespec(name); Newx(dir, VMS_MAXRSS, char); if (do_tovmspath(name,dir,0,NULL) == NULL) { @@ -8792,8 +8789,12 @@ Perl_opendir(pTHX_ const char *name) dd->context = 0; dd->count = 0; dd->flags = 0; - if (unix_flag) - dd->flags = PERL_VMSDIR_M_UNIXSPECS; + /* By saying we always want the result of readdir() in unix format, we + * are really saying we want all the escapes removed. Otherwise the caller, + * having no way to know whether it's already in VMS format, might send it + * through tovmsspec again, thus double escaping. + */ + dd->flags = PERL_VMSDIR_M_UNIXSPECS; dd->pat.dsc$a_pointer = dd->pattern; dd->pat.dsc$w_length = strlen(dd->pattern); dd->pat.dsc$b_dtype = DSC$K_DTYPE_T;