Craig A. Berry [Fri, 16 Mar 2007 01:40:50 +0000 (01:40 +0000)]
filenames from VMS to UNIX syntax.
p4raw-id: //depot/perl@30602
[-] unixify ../
[--] unixify ../../
[...] unixify .../
+__lyrics_:[__are_.__very_^.__sappy_]__but_^.__rhymes_^.__are_.__true_ unixify /__lyrics_/__are_/__very_.__sappy_/__but_.__rhymes_.__are_.__true_
# and back again
/__some_/__where_/__over_/__the_.__rainbow_ vmsify __some_:[__where_.__over_]__the_.__rainbow_
if ((*cp2 == '^')) {
/* EFS file escape, pass the next character as is */
/* Fix me: HEX encoding for UNICODE not implemented */
- cp2++;
- *(cp1++) = *cp2;
+ *(cp1++) = *(++cp2);
+ /* An escaped dot stays as is -- don't convert to slash */
+ if (*cp2 == '.') cp2++;
}
if (*cp2 == ':') {
*(cp1++) = '/';
}
else *(cp1++) = *cp2;
}
- while (*cp2) *(cp1++) = *(cp2++);
+ while (*cp2) {
+ if ((*cp2 == '^') && (*(cp2+1) == '.')) cp2++; /* '^.' --> '.' */
+ *(cp1++) = *(cp2++);
+ }
*cp1 = '\0';
/* This still leaves /000000/ when working with a