Better escaping of dots in tovmsspec.
authorCraig A. Berry <craigberry@mac.com>
Sun, 2 Dec 2012 21:17:55 +0000 (15:17 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sun, 2 Dec 2012 21:17:55 +0000 (15:17 -0600)
commitc1abd561a0a322ca22ba5ef8301a708c37336afb
tree00daa9b60c3aefb13ec0143b1ed50175141bd49f
parenta84b1d1f981773674baedc3f054c82b3243c6136
Better escaping of dots in tovmsspec.

When converting a filename with multiple dots to native VMS syntax,
it's necessary to escape all but the last dot with a caret ('^').
We've been doing this for some time, but have been doing it blindly
such that multiple trips through the converter resulted in a
stuttering caret problem (e.g., foo^^^.bar.pl when foo^.bar.pl was
intended).

So create a convenience macro that does the escaping and make it
only escape unescaped instances and also make it check that the
escape doesn't push us off the end of the buffer we are working
on.

Use the new macro in the three most obvious places that it's
applicable.  There may be other places that also should use it.
vms/vms.c