changeset 1351:0f2b9d0b1f7a draft

Move toys.toycount initialization _after_ zeroing toys, so help -a works again.
author Rob Landley <rob@landley.net>
date Wed, 11 Jun 2014 22:13:28 -0500
parents bb9c601122b8
children 577f6535e787
files main.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Wed Jun 11 08:11:38 2014 -0500
+++ b/main.c	Wed Jun 11 22:13:28 2014 -0500
@@ -81,6 +81,7 @@
   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 @@
 {
   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);