From 3162c27324bb6a26cfb9e47b266d2a3ee451f47b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 6 Dec 2012 15:13:30 -0600 Subject: Have dirtree_add_node() set parent so error message can provide full path. --- toys/posix/chgrp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'toys/posix/chgrp.c') diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c index ed2ff9b2..802d8f8f 100644 --- a/toys/posix/chgrp.c +++ b/toys/posix/chgrp.c @@ -71,7 +71,7 @@ static int do_chgrp(struct dirtree *node) void chgrp_main(void) { - int ischown = toys.which->name[2] == 'o'; + int ischown = toys.which->name[2] == 'o', hl = toys.optflags&(FLAG_H|FLAG_L); char **s, *own; // Distinguish chown from chgrp @@ -103,8 +103,7 @@ void chgrp_main(void) } for (s=toys.optargs+1; *s; s++) { - struct dirtree *new = dirtree_add_node(AT_FDCWD, *s, - toys.optflags&(FLAG_H|FLAG_L)); + struct dirtree *new = dirtree_add_node(0, *s, hl); if (new) handle_callback(new, do_chgrp); else toys.exitval = 1; } -- cgit v1.2.3