summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-06-11 22:13:28 -0500
committerRob Landley <rob@landley.net>2014-06-11 22:13:28 -0500
commit90b200cac621ee925476297a2b70ddf3101cbb45 (patch)
tree1eefe42fab8e09389213c4d7033943cd689c1a4a /main.c
parentff2bc8551c697a909118f580b26b6cb1e0e47f61 (diff)
downloadtoybox-90b200cac621ee925476297a2b70ddf3101cbb45.tar.gz
toybox-90b200cac621ee925476297a2b70ddf3101cbb45.tar.bz2
toybox-90b200cac621ee925476297a2b70ddf3101cbb45.zip
Move toys.toycount initialization _after_ zeroing toys, so help -a works again.
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/main.c b/main.c
index f0969df..fdb4749 100644
--- a/main.c
+++ b/main.c
@@ -81,6 +81,7 @@ static void toy_singleinit(struct toy_list *which, char *argv[])
toys.old_umask = umask(0);
if (!(which->flags & TOYFLAG_UMASK)) umask(toys.old_umask);
toys.signalfd--;
+ toys.toycount = ARRAY_LEN(toy_list);
}
// Setup toybox global state for this command.
@@ -167,8 +168,6 @@ int main(int argc, char *argv[])
{
if (CFG_TOYBOX_I18N) setlocale(LC_ALL, "");
- toys.toycount = ARRAY_LEN(toy_list);
-
if (CFG_TOYBOX) {
// Trim path off of command name
*argv = basename(*argv);