aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-12 22:35:19 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-12 22:35:19 +0000
commitf5f75c5e82d47613847c356664e47c4be69e73aa (patch)
treee71a09d744a9db75a1cbe6cb73d55e71a435e7d1 /shell
parentf312e32662f6d98f86c68d8f781b3255547f8200 (diff)
downloadbusybox-f5f75c5e82d47613847c356664e47c4be69e73aa.tar.gz
remove nearly-duplicate PATHs in several places
function old new delta bb_PATH_root_path - 35 +35 varunset 60 58 -2 arith 2042 2033 -9 bb_default_root_login_path 30 - -30 .rodata 128794 128762 -32 which_main 152 117 -35 defpathvar 40 - -40 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 0/4 up/down: 35/-148) Total: -113 bytes
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c6
-rw-r--r--shell/msh.c4
2 files changed, 4 insertions, 6 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 29d8713b7..ae078e609 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -1581,7 +1581,6 @@ static unsigned long rseed;
# define VDYNAMIC 0
#endif
-static const char defpathvar[] = "PATH=/usr/local/bin:/usr/bin:/sbin:/bin";
#ifdef IFS_BROKEN
static const char defifsvar[] = "IFS= \t\n";
#define defifs (defifsvar + 4)
@@ -1674,7 +1673,7 @@ static struct var varinit[] = {
{ NULL, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL\0", changemail },
{ NULL, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH\0", changemail },
#endif
- { NULL, VSTRFIXED|VTEXTFIXED, defpathvar, changepath },
+ { NULL, VSTRFIXED|VTEXTFIXED, bb_PATH_root_path, changepath },
{ NULL, VSTRFIXED|VTEXTFIXED, "PS1=$ ", NULL },
{ NULL, VSTRFIXED|VTEXTFIXED, "PS2=> ", NULL },
{ NULL, VSTRFIXED|VTEXTFIXED, "PS4=+ ", NULL },
@@ -1710,7 +1709,6 @@ static struct var varinit[] = {
#else
#define vrandom (&vps4)[1]
#endif
-#define defpath (defpathvar + 5)
/*
* The following macros access the values of the above variables.
@@ -7874,7 +7872,7 @@ parse_command_args(char **argv, const char **path)
do {
switch (c) {
case 'p':
- *path = defpath;
+ *path = bb_default_path;
break;
default:
/* run 'typecmd' for other options */
diff --git a/shell/msh.c b/shell/msh.c
index 2ee5256f7..dc2fa9c16 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -5213,9 +5213,9 @@ int msh_main(int argc, char **argv)
if (path->value == null) {
/* Can be merged with same string elsewhere in bbox */
if (geteuid() == 0)
- setval(path, bb_default_root_login_path);
+ setval(path, bb_default_root_path);
else
- setval(path, bb_default_login_path);
+ setval(path, bb_default_path);
}
export(path);