commit c53230037ac8ebed34ff8bf1af0a94aea0843c2e
parent 521fc081802282bac261c3639e9c77fe131f1d42
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date: Sun, 31 Oct 2021 01:30:46 +0100
sam: use get9root instead of duplicating the logic
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/cmd/sam/sam.c b/src/cmd/sam/sam.c
@@ -152,9 +152,7 @@ rescue(void)
free(c);
}else
sprint(buf, "nameless.%d", nblank++);
- root = getenv("PLAN9");
- if(root == nil)
- root = "/usr/local/plan9";
+ root = get9root();
fprint(io, "#!/bin/sh\n%s/bin/samsave '%s' $* <<'---%s'\n", root, buf, buf);
addr.r.p1 = 0, addr.r.p2 = f->b.nc;
writeio(f);