aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/chgrp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-12-06 15:13:30 -0600
committerRob Landley <rob@landley.net>2012-12-06 15:13:30 -0600
commit3162c27324bb6a26cfb9e47b266d2a3ee451f47b (patch)
tree0aa4d5cd7af9f9f3398ade523bddcfd2110fea57 /toys/posix/chgrp.c
parent5434415c11af6ea91f61fe2e873cfc29afc5657f (diff)
downloadtoybox-3162c27324bb6a26cfb9e47b266d2a3ee451f47b.tar.gz
Have dirtree_add_node() set parent so error message can provide full path.
Diffstat (limited to 'toys/posix/chgrp.c')
-rw-r--r--toys/posix/chgrp.c5
1 files changed, 2 insertions, 3 deletions
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;
}