From accde25e09f39d3aca64a50c72f23bf84d312757 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Tue, 15 Mar 2011 15:44:47 +0800 Subject: [EVAL] Let funcnode refer to a function definition, not its first command It is not unrelated: I changed the meaning of struct funcnode's field n to refer to the function definition, rather than the list of the function's commands, because I needed to refer to the function definition node from evalfun, which only gets passed a funcnode. But it is something that could be applied independently (without being useful by itself), so I've attached it as a separate patch for easier review. Signed-off-by: Harald van Dijk Signed-off-by: Herbert Xu --- src/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/exec.c') diff --git a/src/exec.c b/src/exec.c index 194088b..a13ad67 100644 --- a/src/exec.c +++ b/src/exec.c @@ -690,14 +690,14 @@ addcmdentry(char *name, struct cmdentry *entry) */ void -defun(char *name, union node *func) +defun(union node *func) { struct cmdentry entry; INTOFF; entry.cmdtype = CMDFUNCTION; entry.u.func = copyfunc(func); - addcmdentry(name, &entry); + addcmdentry(func->narg.text, &entry); INTON; } -- cgit 1.4.1