Since it's impossible to guarantee a filename is never makes
multiple trips through the Unix-to-VMS converter, it's important
not to escape characters that have already been escaped.
*(cp1++) = '?';
cp2++;
case ' ':
- *(cp1)++ = '^';
+ if (cp2 > path && *(cp2-1) != '^') /* not previously escaped */
+ *(cp1)++ = '^';
*(cp1)++ = '_';
cp2++;
break;
case '|':
case '<':
case '>':
- *(cp1++) = '^';
+ if (cp2 > path && *(cp2-1) != '^') /* not previously escaped */
+ *(cp1++) = '^';
*(cp1++) = *(cp2++);
break;
case ';':