diff options
author | harti <harti@FreeBSD.org> | 2005-03-08 14:33:58 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-03-08 14:33:58 +0000 |
commit | 71a2608310c08c708103c9733d2e732bb8325de8 (patch) | |
tree | 7d6efbea581b654bb84a23be298ecb424290ad41 | |
parent | 645fdd0f1152d4a3acc8d14f9ab9bf2670133108 (diff) | |
download | FreeBSD-src-71a2608310c08c708103c9733d2e732bb8325de8.zip FreeBSD-src-71a2608310c08c708103c9733d2e732bb8325de8.tar.gz |
Use the Buf_Peel function to get to the string contained into a
buffer without using an extra local variable.
-rw-r--r-- | usr.bin/make/compat.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index dd83a34..a60f331 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -238,7 +238,6 @@ Compat_RunCommand(char *cmd, GNode *gn) LstNode *cmdNode; /* Node where current command is located */ char **av; /* Argument vector for thing to exec */ char *cmd_save; /* saved cmd */ - Buffer *buf; /* * Avoid clobbered variable warnings by forcing the compiler @@ -253,10 +252,7 @@ Compat_RunCommand(char *cmd, GNode *gn) doit = FALSE; cmdNode = Lst_Member(&gn->commands, cmd); - - buf = Var_Subst(NULL, cmd, gn, FALSE); - cmdStart = Buf_GetAll(buf, NULL); - Buf_Destroy(buf, FALSE); + cmdStart = Buf_Peel(Var_Subst(NULL, cmd, gn, FALSE)); /* * brk_string will return an argv with a NULL in av[0], thus causing |