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-w32-f5f75c5e82d47613847c356664e47c4be69e73aa.tar.gz
busybox-w32-f5f75c5e82d47613847c356664e47c4be69e73aa.tar.bz2
busybox-w32-f5f75c5e82d47613847c356664e47c4be69e73aa.zip
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;
1581# define VDYNAMIC 0 1581# define VDYNAMIC 0
1582#endif 1582#endif
1583 1583
1584static const char defpathvar[] = "PATH=/usr/local/bin:/usr/bin:/sbin:/bin";
1585#ifdef IFS_BROKEN 1584#ifdef IFS_BROKEN
1586static const char defifsvar[] = "IFS= \t\n"; 1585static const char defifsvar[] = "IFS= \t\n";
1587#define defifs (defifsvar + 4) 1586#define defifs (defifsvar + 4)
@@ -1674,7 +1673,7 @@ static struct var varinit[] = {
1674 { NULL, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL\0", changemail }, 1673 { NULL, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL\0", changemail },
1675 { NULL, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH\0", changemail }, 1674 { NULL, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH\0", changemail },
1676#endif 1675#endif
1677 { NULL, VSTRFIXED|VTEXTFIXED, defpathvar, changepath }, 1676 { NULL, VSTRFIXED|VTEXTFIXED, bb_PATH_root_path, changepath },
1678 { NULL, VSTRFIXED|VTEXTFIXED, "PS1=$ ", NULL }, 1677 { NULL, VSTRFIXED|VTEXTFIXED, "PS1=$ ", NULL },
1679 { NULL, VSTRFIXED|VTEXTFIXED, "PS2=> ", NULL }, 1678 { NULL, VSTRFIXED|VTEXTFIXED, "PS2=> ", NULL },
1680 { NULL, VSTRFIXED|VTEXTFIXED, "PS4=+ ", NULL }, 1679 { NULL, VSTRFIXED|VTEXTFIXED, "PS4=+ ", NULL },
@@ -1710,7 +1709,6 @@ static struct var varinit[] = {
1710#else 1709#else
1711#define vrandom (&vps4)[1] 1710#define vrandom (&vps4)[1]
1712#endif 1711#endif
1713#define defpath (defpathvar + 5)
1714 1712
1715/* 1713/*
1716 * The following macros access the values of the above variables. 1714 * The following macros access the values of the above variables.
@@ -7874,7 +7872,7 @@ parse_command_args(char **argv, const char **path)
7874 do { 7872 do {
7875 switch (c) { 7873 switch (c) {
7876 case 'p': 7874 case 'p':
7877 *path = defpath; 7875 *path = bb_default_path;
7878 break; 7876 break;
7879 default: 7877 default:
7880 /* run 'typecmd' for other options */ 7878 /* 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)
5213 if (path->value == null) { 5213 if (path->value == null) {
5214 /* Can be merged with same string elsewhere in bbox */ 5214 /* Can be merged with same string elsewhere in bbox */
5215 if (geteuid() == 0) 5215 if (geteuid() == 0)
5216 setval(path, bb_default_root_login_path); 5216 setval(path, bb_default_root_path);
5217 else 5217 else
5218 setval(path, bb_default_login_path); 5218 setval(path, bb_default_path);
5219 } 5219 }
5220 export(path); 5220 export(path);
5221 5221