Mercurial > hg > toybox
comparison main.c @ 873:d90f14e011b8
Fix some comments from way back when toybox first started (in 2006), when I was still cleaning busybox-isms out of my head...
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 21 Apr 2013 12:15:59 -0500 |
parents | 3d7526f6115b |
children | 60a430b7791e |
comparison
equal
deleted
inserted
replaced
872:793972c94560 | 873:d90f14e011b8 |
---|---|
14 | 14 |
15 struct toy_list toy_list[] = { | 15 struct toy_list toy_list[] = { |
16 #include "generated/newtoys.h" | 16 #include "generated/newtoys.h" |
17 }; | 17 }; |
18 | 18 |
19 // global context for this applet. | 19 // global context for this command. |
20 | 20 |
21 struct toy_context toys; | 21 struct toy_context toys; |
22 union global_union this; | 22 union global_union this; |
23 char toybuf[4096]; | 23 char toybuf[4096]; |
24 | 24 |
30 // skip the first entry, which is out of order. | 30 // skip the first entry, which is out of order. |
31 | 31 |
32 if (!strncmp(name,"toybox",6)) return toy_list; | 32 if (!strncmp(name,"toybox",6)) return toy_list; |
33 bottom = 1; | 33 bottom = 1; |
34 | 34 |
35 // Binary search to find this applet. | 35 // Binary search to find this command. |
36 | 36 |
37 top = ARRAY_LEN(toy_list)-1; | 37 top = ARRAY_LEN(toy_list)-1; |
38 for (;;) { | 38 for (;;) { |
39 int result; | 39 int result; |
40 | 40 |
121 toy_exec(toys.argv+1); | 121 toy_exec(toys.argv+1); |
122 error_exit("Unknown command %s",toys.argv[1]); | 122 error_exit("Unknown command %s",toys.argv[1]); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 // Output list of applets. | 126 // Output list of command. |
127 for (i=1; i<ARRAY_LEN(toy_list); i++) { | 127 for (i=1; i<ARRAY_LEN(toy_list); i++) { |
128 int fl = toy_list[i].flags; | 128 int fl = toy_list[i].flags; |
129 if (fl & TOYMASK_LOCATION) { | 129 if (fl & TOYMASK_LOCATION) { |
130 if (toys.argv[1]) { | 130 if (toys.argv[1]) { |
131 int j; | 131 int j; |