diff options
Diffstat (limited to 'applets')
-rw-r--r-- | applets/.gitignore | 3 | ||||
-rw-r--r-- | applets/applet_tables.c | 9 | ||||
-rwxr-xr-x | applets/usage_compressed | 2 | ||||
-rw-r--r-- | applets/usage_pod.c | 17 |
4 files changed, 26 insertions, 5 deletions
diff --git a/applets/.gitignore b/applets/.gitignore index 459938d67..970bb90a9 100644 --- a/applets/.gitignore +++ b/applets/.gitignore | |||
@@ -1,3 +1,6 @@ | |||
1 | /applet_tables | 1 | /applet_tables |
2 | /usage | 2 | /usage |
3 | /usage_pod | 3 | /usage_pod |
4 | /applet_tables.exe | ||
5 | /usage.exe | ||
6 | /usage_pod.exe | ||
diff --git a/applets/applet_tables.c b/applets/applet_tables.c index 66ef7e4ac..fe26a5109 100644 --- a/applets/applet_tables.c +++ b/applets/applet_tables.c | |||
@@ -103,6 +103,9 @@ int main(int argc, char **argv) | |||
103 | if (i < 0) | 103 | if (i < 0) |
104 | return 1; | 104 | return 1; |
105 | dup2(i, 1); | 105 | dup2(i, 1); |
106 | #ifdef __MINGW32__ | ||
107 | close(i); | ||
108 | #endif | ||
106 | 109 | ||
107 | /* Keep in sync with include/busybox.h! */ | 110 | /* Keep in sync with include/busybox.h! */ |
108 | 111 | ||
@@ -236,8 +239,14 @@ int main(int argc, char **argv) | |||
236 | 239 | ||
237 | if (fclose(stdout)) | 240 | if (fclose(stdout)) |
238 | return 1; | 241 | return 1; |
242 | #ifdef __MINGW32__ | ||
243 | unlink(argv[1]); | ||
244 | #endif | ||
239 | if (rename(tmp1, argv[1])) | 245 | if (rename(tmp1, argv[1])) |
240 | return 1; | 246 | return 1; |
247 | #ifdef __MINGW32__ | ||
248 | unlink(argv[2]); | ||
249 | #endif | ||
241 | if (rename(tmp2, argv[2])) | 250 | if (rename(tmp2, argv[2])) |
242 | return 1; | 251 | return 1; |
243 | return 0; | 252 | return 0; |
diff --git a/applets/usage_compressed b/applets/usage_compressed index 36fc2a007..94d70f33b 100755 --- a/applets/usage_compressed +++ b/applets/usage_compressed | |||
@@ -16,6 +16,7 @@ if test $? != 0; then | |||
16 | exit 1 | 16 | exit 1 |
17 | fi | 17 | fi |
18 | 18 | ||
19 | ( | ||
19 | exec >"$target.$$" | 20 | exec >"$target.$$" |
20 | 21 | ||
21 | echo '#define UNPACKED_USAGE "" \' | 22 | echo '#define UNPACKED_USAGE "" \' |
@@ -58,5 +59,6 @@ echo '#define PACKED_USAGE \' | |||
58 | -e 's/\(...\)/0\1,/g' \ | 59 | -e 's/\(...\)/0\1,/g' \ |
59 | -e 's/$/ \\/' | 60 | -e 's/$/ \\/' |
60 | echo '' | 61 | echo '' |
62 | ) | ||
61 | 63 | ||
62 | mv -- "$target.$$" "$target" | 64 | mv -- "$target.$$" "$target" |
diff --git a/applets/usage_pod.c b/applets/usage_pod.c index 9e6d3f0ee..2c177be90 100644 --- a/applets/usage_pod.c +++ b/applets/usage_pod.c | |||
@@ -67,30 +67,37 @@ int main(void) | |||
67 | } | 67 | } |
68 | if (col == 0) { | 68 | if (col == 0) { |
69 | col = 6; | 69 | col = 6; |
70 | printf("\t"); | ||
71 | } else { | 70 | } else { |
72 | printf(", "); | 71 | printf(", "); |
73 | } | 72 | } |
74 | printf("%s", usage_array[i].aname); | 73 | if (usage_array[i].usage[0] != NOUSAGE_STR[0]) { |
74 | /* | ||
75 | * If the applet usage string will be included in the final document | ||
76 | * optimistically link to its header (which is just the applet name). | ||
77 | */ | ||
78 | printf("L<C<%1$s>|/\"%1$s\">", usage_array[i].aname); | ||
79 | } else { | ||
80 | /* Without a usage string, just output the applet name with no link. */ | ||
81 | printf("C<%s>", usage_array[i].aname); | ||
82 | } | ||
75 | col += len2; | 83 | col += len2; |
76 | } | 84 | } |
77 | printf("\n\n"); | 85 | printf("\n\n"); |
78 | 86 | ||
79 | printf("=head1 COMMAND DESCRIPTIONS\n\n"); | 87 | printf("=head1 COMMAND DESCRIPTIONS\n\n"); |
80 | printf("=over 4\n\n"); | ||
81 | 88 | ||
82 | for (i = 0; i < num_messages; i++) { | 89 | for (i = 0; i < num_messages; i++) { |
83 | if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z' | 90 | if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z' |
84 | && usage_array[i].usage[0] != NOUSAGE_STR[0] | 91 | && usage_array[i].usage[0] != NOUSAGE_STR[0] |
85 | ) { | 92 | ) { |
86 | printf("=item B<%s>\n\n", usage_array[i].aname); | 93 | /* This is the heading that will be linked from the command list. */ |
94 | printf("=head2 %s\n\n", usage_array[i].aname); | ||
87 | if (usage_array[i].usage[0]) | 95 | if (usage_array[i].usage[0]) |
88 | printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage); | 96 | printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage); |
89 | else | 97 | else |
90 | printf("%s\n\n", usage_array[i].aname); | 98 | printf("%s\n\n", usage_array[i].aname); |
91 | } | 99 | } |
92 | } | 100 | } |
93 | printf("=back\n\n"); | ||
94 | 101 | ||
95 | return 0; | 102 | return 0; |
96 | } | 103 | } |