#include #include /* * I don't want too many of these, * but the ones we have are just too useful. */ static struct { char *old; char *new; } replace[] = { "#9", nil, /* must be first */ "#d", "/dev/fd", }; char* plan9translate(char *old) { char *new; int i, olen, nlen, len; if(replace[0].new == nil){ replace[0].new = getenv("PLAN9"); if(replace[0].new == nil) replace[0].new = "/usr/local/plan9"; } for(i=0; i"; strcpy(new, replace[i].new); strcpy(new+nlen, old+olen); assert(strlen(new) == len); return new; } return old; }