This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make vmsify support files with no directory component.
authorCraig A. Berry <craigberry@mac.com>
Wed, 6 Feb 2013 01:04:23 +0000 (19:04 -0600)
committerCraig A. Berry <craigberry@mac.com>
Wed, 6 Feb 2013 01:04:23 +0000 (19:04 -0600)
commit59247333b91dc05c865ef5c89f217a9695709cb8
tree999df3fb054a43aef71d65fe21a523fa7b9513f4
parent0c50187808c90649d93897951eb5d95c20c23588
Make vmsify support files with no directory component.

We've been assuming there is always a directory portion to a path
being converted to VMS format, and it's true that translating
directory delimiters and such is the most noticeable aspect of
such conversions.  But we also depend on the conversion to add
caret escapes to characters in the path that are only valid when
using Extended Filename Syntax (EFS), but weren't doing that
for paths with no directory component.

I.e., this was working:

/disk/dir/foo%bar --> disk:[dir]foo^%bar

but this was not (until now):

foo%bar --> foo^%bar

Since we're now working on a pointer that has not necessarily
been incremented while adding directory syntax, we also add
a number of guards to make sure we don't peek beyond the
beginning of the result string.

N.B.  There will be a separate commit following shortly that
prevents paths with no directory component from being passed
through as-is -- here we just provide the infrastructure to
make that possible.
vms/vms.c