aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-06 05:17:57 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-06 05:17:57 +0000
commitfcffa2cc1a0f11ea6a075dd37762ca5b543b55e1 (patch)
treeb692176a654613bb68ca37c42f88201aeb48d8ba /applets
parent50e4d660ace54d8da2cb09d537138447a92c68bd (diff)
downloadbusybox-fcffa2cc1a0f11ea6a075dd37762ca5b543b55e1.tar.gz
Apply lash_patch35 from vodz, which brings several nice size_optimizations.
Diffstat (limited to 'applets')
-rw-r--r--applets/busybox.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index 858358175..4f1ef2661 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -18,12 +18,15 @@ const char *applet_name;
* this should be consistent w/ the enum, busybox.h::Location,
* or else...
*/
-static char* install_dir[] = {
- "/",
- "/bin",
- "/sbin",
- "/usr/bin",
- "/usr/sbin",
+static const char usr_bin [] ="/usr/bin";
+static const char usr_sbin[] ="/usr/sbin";
+
+static const char* const install_dir[] = {
+ &usr_bin [8], /* "", equivalent to "/" for concat_path_file() */
+ &usr_bin [4], /* "/bin" */
+ &usr_sbin[4], /* "/sbin" */
+ usr_bin,
+ usr_sbin
};
/* abstract link() */
@@ -35,7 +38,7 @@ typedef int (*__link_f)(const char *, const char *);
* malloc'd string w/ full pathname of busybox's location
* NULL on failure
*/
-static char *busybox_fullpath(void)
+static inline char *busybox_fullpath(void)
{
return xreadlink("/proc/self/exe");
}