Fix unescaped first character in tovmsspec.
authorCraig A. Berry <craigberry@mac.com>
Sat, 21 Dec 2013 00:11:15 +0000 (18:11 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 21 Dec 2013 00:52:36 +0000 (18:52 -0600)
commit2e82b6ce46e012458b738a5c24d9ed52f5a54d3d
tree2426feaa30dba080f186d36737efb101da01ae54
parent8da0169c5cf5e6fd8ad2fceb04286b6a44ca381d
Fix unescaped first character in tovmsspec.

Passing a path to int_tovmsspec that contained an "extended"
character as the first character when converting a Unix filespec
to VMS format skipped escaping that character, but only when the
path spec had no directory component.  The character that didn't
get escaped could then be passed to a native service that choked
or incorrectly processed it.  For example ' foo.txt' remained,
after translation, ' foo.txt', but parsing that as a native spec
would squeeze out the leading space.

So we now make sure we don't eat the first character of the
filename component while processing the directory component and
also handle escaping the very first character.  In the example
of ' foo.txt', it now gets correctly translated to '^_foo.txt'.
ext/VMS-Filespec/t/filespec.t
vms/vms.c