/* Fix unix pathname for AmigaDOS [":/" --> ":", "/blah" --> ":bla"] */ char *fixupname(name) char *name; { register char *s, *d; char * buffer; char *xmalloc(); buffer = xmalloc(256); s = name; d = buffer; if (*s == '/') { /* Fix leading slash (root dir) */ *d++ = ':'; s++; } else if (*s == '.') { /* fix leading "./" (Current dir) */ if (*(s+1L) == '/') { s++; s++; }; /* Leave it out */ }; /* And now try to handle volume names correctly */ while ((*s != '\0') && (*s != ':')) *d++ = *s++; if (*s != '\0') { *d++ = *s++; /* copy ":" */ if (*s == '/') s++; while (*s != '\0') *d++ = *s++; }; *d = '\0'; return(buffer); }