aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-01-13 16:48:58 -0500
committerRuss Cox <rsc@swtch.com>2020-01-13 16:48:58 -0500
commitbe263a722e8957d99f2a51bb11106103bf878b44 (patch)
tree48a8f23a10045f9620a92f0b8ce7f94b158ea449 /src
parent04da0159764152b99b7dd0f33ace7d97ae7c2aa1 (diff)
downloadplan9port-be263a722e8957d99f2a51bb11106103bf878b44.tar.gz
plan9port-be263a722e8957d99f2a51bb11106103bf878b44.tar.bz2
plan9port-be263a722e8957d99f2a51bb11106103bf878b44.zip
lib9: rm unused _p9translate.c
Fixes #238.
Diffstat (limited to 'src')
-rw-r--r--src/lib9/_p9translate.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/lib9/_p9translate.c b/src/lib9/_p9translate.c
deleted file mode 100644
index 74df43c5..00000000
--- a/src/lib9/_p9translate.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <u.h>
-#include <libc.h>
-
-/*
- * 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<nelem(replace); i++){
- if(!replace[i].new)
- continue;
- olen = strlen(replace[i].old);
- if(strncmp(old, replace[i].old, olen) != 0
- || (old[olen] != '\0' && old[olen] != '/'))
- continue;
- nlen = strlen(replace[i].new);
- len = strlen(old)+nlen-olen;
- new = malloc(len+1);
- if(new == nil)
- return "<out of memory>";
- strcpy(new, replace[i].new);
- strcpy(new+nlen, old+olen);
- assert(strlen(new) == len);
- return new;
- }
- return old;
-}