diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-04-09 22:48:12 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-04-09 22:48:12 +0000 |
| commit | e5dfced23a904d08afa5dcee190c3c3d845d9f50 (patch) | |
| tree | ef367ee8a9096884fb40debdc9e10af8583f9d5f /applets | |
| parent | a75e2867435faa68ea03735fe09ad298fa3e4e72 (diff) | |
| download | busybox-w32-e5dfced23a904d08afa5dcee190c3c3d845d9f50.tar.gz busybox-w32-e5dfced23a904d08afa5dcee190c3c3d845d9f50.tar.bz2 busybox-w32-e5dfced23a904d08afa5dcee190c3c3d845d9f50.zip | |
Apply Vladimir's latest cleanup patch.
-Erik
Diffstat (limited to 'applets')
| -rw-r--r-- | applets/busybox.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/applets/busybox.c b/applets/busybox.c index 5085556d6..9db26df27 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
| @@ -10,6 +10,10 @@ | |||
| 10 | #define BB_DECLARE_EXTERN | 10 | #define BB_DECLARE_EXTERN |
| 11 | #include "messages.c" | 11 | #include "messages.c" |
| 12 | 12 | ||
| 13 | #ifdef BB_LOCALE_SUPPORT | ||
| 14 | #include <locale.h> | ||
| 15 | #endif | ||
| 16 | |||
| 13 | int been_there_done_that = 0; /* Also used in applets.c */ | 17 | int been_there_done_that = 0; /* Also used in applets.c */ |
| 14 | const char *applet_name; | 18 | const char *applet_name; |
| 15 | 19 | ||
| @@ -60,7 +64,7 @@ static void install_links(const char *busybox, int use_symbolic_links) | |||
| 60 | { | 64 | { |
| 61 | __link_f Link = link; | 65 | __link_f Link = link; |
| 62 | 66 | ||
| 63 | char command[256]; | 67 | char *fpc; |
| 64 | int i; | 68 | int i; |
| 65 | int rc; | 69 | int rc; |
| 66 | 70 | ||
| @@ -68,13 +72,13 @@ static void install_links(const char *busybox, int use_symbolic_links) | |||
| 68 | Link = symlink; | 72 | Link = symlink; |
| 69 | 73 | ||
| 70 | for (i = 0; applets[i].name != NULL; i++) { | 74 | for (i = 0; applets[i].name != NULL; i++) { |
| 71 | sprintf ( command, "%s/%s", | 75 | fpc = concat_path_file( |
| 72 | install_dir[applets[i].location], applets[i].name); | 76 | install_dir[applets[i].location], applets[i].name); |
| 73 | rc = Link(busybox, command); | 77 | rc = Link(busybox, fpc); |
| 74 | 78 | if (rc!=0 && errno!=EEXIST) { | |
| 75 | if (rc) { | 79 | perror_msg("%s", fpc); |
| 76 | perror_msg("%s", command); | ||
| 77 | } | 80 | } |
| 81 | free(fpc); | ||
| 78 | } | 82 | } |
| 79 | } | 83 | } |
| 80 | 84 | ||
| @@ -97,6 +101,11 @@ int main(int argc, char **argv) | |||
| 97 | } | 101 | } |
| 98 | #endif | 102 | #endif |
| 99 | 103 | ||
| 104 | #ifdef BB_LOCALE_SUPPORT | ||
| 105 | if(getpid()!=1) /* Do not set locale for `init' */ | ||
| 106 | setlocale(LC_ALL, ""); | ||
| 107 | #endif | ||
| 108 | |||
| 100 | run_applet_by_name(applet_name, argc, argv); | 109 | run_applet_by_name(applet_name, argc, argv); |
| 101 | error_msg_and_die("applet not found"); | 110 | error_msg_and_die("applet not found"); |
| 102 | } | 111 | } |
