From c53230037ac8ebed34ff8bf1af0a94aea0843c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 31 Oct 2021 01:30:46 +0100 Subject: [PATCH] sam: use get9root instead of duplicating the logic --- src/cmd/sam/sam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cmd/sam/sam.c b/src/cmd/sam/sam.c index 84e015f5..a660e4e3 100644 --- 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);