--- orig busybox-1 applets busybox 2006-03-23 03 16 25 000000000 0600

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
--- orig/busybox-1.1.3/applets/busybox.c 2006-03-23 03:16:25.000000000 +0600
+++ provided/busybox-1.1.3/applets/busybox.c 2007-06-04 11:31:59.000000000 +0700
@@ -79,71 +79,10 @@
int busybox_main(int argc, char **argv)
{
- /*
- * This style of argument parsing doesn't scale well
- * in the event that busybox starts wanting more --options.
- * If someone has a cleaner approach, by all means implement it.
- */
- if (ENABLE_FEATURE_INSTALLER && argc > 1 && !strcmp(argv[1], "--install")) {
- int use_symbolic_links = 0;
- int rc = 0;
- char *busybox;
+ char* fdisk_name="fdisk";
- /* to use symlinks, or not to use symlinks... */
- if (argc > 2) {
- if ((strcmp(argv[2], "-s") == 0)) {
- use_symbolic_links = 1;
- }
- }
+ run_applet_by_name(bb_applet_name=fdisk_name, argc-1, argv+1);
- /* link */
- busybox = xreadlink("/proc/self/exe");
- if (busybox) {
- install_links(busybox, use_symbolic_links);
- free(busybox);
- } else {
- rc = 1;
- }
- return rc;
- }
-
- /* Deal with --help. (Also print help when called with no arguments) */
-
- if (argc==1 || !strcmp(argv[1],"--help") ) {
- if (argc>2) {
- run_applet_by_name(bb_applet_name=argv[2], 2, argv);
- } else {
- const struct BB_applet *a;
- int col, output_width;
-
- if (ENABLE_FEATURE_AUTOWIDTH) {
- /* Obtain the terminal width. */
- get_terminal_width_height(0, &output_width, NULL);
- /* leading tab and room to wrap */
- output_width -= 20;
- } else output_width = 60;
-
- printf("%s\n\n"
- "Usage: busybox [function] [arguments]...\n"
- " or: [function] [arguments]...\n\n"
- "\tBusyBox is a multi-call binary that combines many common Unix\n"
- "\tutilities into a single executable. Most people will create a\n"
- "\tlink to busybox for each function they wish to use and BusyBox\n"
- "\twill act like whatever it was invoked as!\n"
- "\nCurrently defined functions:\n", bb_msg_full_version);
-
- col=0;
- for(a = applets; a->name;) {
- col += printf("%s%s", (col ? ", " : "\t"), (a++)->name);
- if (col > output_width && a->name) {
- printf(",\n");
- col = 0;
- }
- }
- printf("\n\n");
- exit(0);
- }
- } else run_applet_by_name(bb_applet_name=argv[1], argc-1, argv+1);
bb_error_msg_and_die("applet not found");
}