In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e283d9f3eca0ba7ff8f9bb3fe8cb8611758c7918?hp=3ef6b8e9a9da2a3d97ef32e4df629373ca2ab5f9>
- Log ----------------------------------------------------------------- commit e283d9f3eca0ba7ff8f9bb3fe8cb8611758c7918 Author: Craig A. Berry <[email protected]> Date: Tue Nov 18 19:03:51 2014 -0600 Escape EFS for directory portion in tovmsspec. For some reason extended characters were only being escaped in the final component of the path, but not in the directory portion, the one exception being dots. We need to give the entire path the same treatment. There is probably considerable opportunity for further consolidation and refactoring in what we escape, but at least now ../foo bar/ correctly becomes [-.foo^_^_bar]. The reverse case has similar problems and is a TODO. ----------------------------------------------------------------------- Summary of changes: ext/VMS-Filespec/t/filespec.t | 2 ++ vms/vms.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/VMS-Filespec/t/filespec.t b/ext/VMS-Filespec/t/filespec.t index 0f31f85..fe91ae0 100644 --- a/ext/VMS-Filespec/t/filespec.t +++ b/ext/VMS-Filespec/t/filespec.t @@ -107,6 +107,7 @@ __some_:<__where_.__over_>__the_.__rainbow_ unixify /__some_/__where_/__over_ __lyrics_:[__are_.__very_^.__sappy_]__but_^.__rhymes_^.__are_.__true_ unixify /__lyrics_/__are_/__very_.__sappy_/__but_.__rhymes_.__are_.__true_ ^ [.$(macro)] unixify $(macro)/ ^ ^+foo.tmp unixify +foo.tmp ^ +[-.foo^_^_bar] unixify ../foo\ \ bar/ ^* # and back again /__some_/__where_/__over_/__the_.__rainbow_ vmsify __some_:[__where_.__over_]__the_.__rainbow_ ^ @@ -131,6 +132,7 @@ __some_/__where_/... vmsify [.__some_.__where_...] ^ foo-bar-0^.01/ vmsify [.foo-bar-0_01] [.foo-bar-0^.01] \ foo.tmp vmsify ^_foo.tmp ^ +foo.tmp vmsify ^+foo.tmp ^ +../foo\ \ bar/ vmsify [-.foo^_^_bar] ^ # Fileifying directory specs __down_:[__the_.__garden_.__path_] fileify __down_:[__the_.__garden_]__path_.dir;1 ^ [.__down_.__the_.__garden_.__path_] fileify [.__down_.__the_.__garden_]__path_.dir;1 ^ diff --git a/vms/vms.c b/vms/vms.c index 4278afe..080e894 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -8591,7 +8591,12 @@ static char *int_tovmsspec VMSEFS_DOT_WITH_ESCAPE(cp1, rslt, VMS_MAXRSS); } } - else *(cp1++) = *cp2; + else { + int out_cnt; + cp2 += copy_expand_unix_filename_escape(cp1, cp2, &out_cnt, utf8_flag); + cp2--; /* we're in a loop that will increment this */ + cp1 += out_cnt; + } infront = 1; } } -- Perl5 Master Repository
