summaryrefslogtreecommitdiff
path: root/configure.com
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2016-12-08 13:14:19 -0600
committerCraig A. Berry <craigberry@mac.com>2016-12-08 13:14:19 -0600
commita2dd16063e263db10679174268644f798e9770e5 (patch)
tree1f243ec26a982ea483ffe236fd7a377461dd070d /configure.com
parenta9aff56e0a39d32229b46a8f14ec04f03919406c (diff)
downloadperl-a2dd16063e263db10679174268644f798e9770e5.tar.gz
Escape extended characters in configure.com's manifest check.
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.
Diffstat (limited to 'configure.com')
-rw-r--r--configure.com24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.com b/configure.com
index ddcd9b4b28..c816620942 100644
--- a/configure.com
+++ b/configure.com
@@ -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)