This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Escape extended characters in configure.com's manifest check.
authorCraig A. Berry <craigberry@mac.com>
Thu, 8 Dec 2016 19:14:19 +0000 (13:14 -0600)
committerCraig A. Berry <craigberry@mac.com>
Thu, 8 Dec 2016 19:14:19 +0000 (13:14 -0600)
Math::BigInt now has a file with '#' in the name.  This broke the
build on VMS because the manifest checker couldn't find that file.
While the current file system can have files with a hash character
or other top-row-of-the-keyboard characters, most of them need
escaping with a caret when used in a filename in native syntax.

So add a more-or-less general purpose escaping routine and run it
on each filename in the manifest before converting from Unix to
VMS syntax.

configure.com

index ddcd9b4..c816620 100644 (file)
@@ -470,6 +470,27 @@ $     EXIT !2 !$STATUS = "%X00000002" (error)
 $   ENDIF
 $Beyond_depth_check:
 $!
+$ escape_extended_chars: subroutine
+$   string = 'p1' ! It's the name of the symbol
+$   chars_to_escape = p2
+$   sindex = 0
+$   slength = f$length(string)
+$   loop_over_chars:
+$     if sindex .eq. slength then goto end_loop_over_chars
+$     char = f$extract(sindex, 1, string)
+$     if f$locate(char, chars_to_escape) .lt. f$length(chars_to_escape)
+$     then
+$       string = f$extract(0, sindex, string) + "^" + f$extract(sindex, slength, string)
+$       slength = slength + 1 ! we've increased overall length by 1
+$       sindex = sindex + 1   ! don't check the char we just escaped again
+$     endif
+$     sindex = sindex + 1
+$     goto loop_over_chars
+$ end_loop_over_chars:
+$ 'p1' == string
+$!
+$ endsubroutine
+$!
 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
 $!
 $   IF (manifestfound .NES. "")
@@ -511,6 +532,9 @@ $       line = F$EDIT(line,"TRIM, COMPRESS")
 $       file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line) 
 $       IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find) 
 $       THEN 
+$         escaped_fname == file_2_find
+$         call escape_extended_chars escaped_fname "~!#&\'`()+@{},;[]%^=\"
+$         file_2_find = escaped_fname
 $Re_strip_line_manifest:
 $         loca = F$LOCATE("/",file_2_find)
 $         ante = F$EXTRACT(0,loca,file_2_find)