diff options
author | Stefan Hellermann <stefan@the2masters.de> | 2013-03-15 02:45:50 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-03-15 02:45:50 +0100 |
commit | 4ef1439c593daadeffb3f00eaaf49e190a3039e1 (patch) | |
tree | 1e2798e8de90e64e90fae17768974010d0e8da9a | |
parent | aeb717aa5e8a5ae650a283306091a2872628cffd (diff) | |
download | busybox-w32-4ef1439c593daadeffb3f00eaaf49e190a3039e1.tar.gz busybox-w32-4ef1439c593daadeffb3f00eaaf49e190a3039e1.tar.bz2 busybox-w32-4ef1439c593daadeffb3f00eaaf49e190a3039e1.zip |
ash: read $HOME/.profile instead of $(pwd)/.profile
ash --login should read ~/.profile instead of .profile in the current
directory. I noticed it while trying to figure out why /root/.profile
is only read sometimes.
function old new delta
ash_main 1374 1398 +24
Signed-off-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 5f09fd474..fbbdb06b0 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13194,11 +13194,18 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13194 | if (argv[0] && argv[0][0] == '-') | 13194 | if (argv[0] && argv[0][0] == '-') |
13195 | isloginsh = 1; | 13195 | isloginsh = 1; |
13196 | if (isloginsh) { | 13196 | if (isloginsh) { |
13197 | const char *hp; | ||
13198 | |||
13197 | state = 1; | 13199 | state = 1; |
13198 | read_profile("/etc/profile"); | 13200 | read_profile("/etc/profile"); |
13199 | state1: | 13201 | state1: |
13200 | state = 2; | 13202 | state = 2; |
13201 | read_profile(".profile"); | 13203 | hp = lookupvar("HOME"); |
13204 | if (hp) { | ||
13205 | hp = concat_path_file(hp, ".profile"); | ||
13206 | read_profile(hp); | ||
13207 | free((char*)hp); | ||
13208 | } | ||
13202 | } | 13209 | } |
13203 | state2: | 13210 | state2: |
13204 | state = 3; | 13211 | state = 3; |
@@ -13232,7 +13239,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13232 | const char *hp = lookupvar("HISTFILE"); | 13239 | const char *hp = lookupvar("HISTFILE"); |
13233 | if (!hp) { | 13240 | if (!hp) { |
13234 | hp = lookupvar("HOME"); | 13241 | hp = lookupvar("HOME"); |
13235 | if(hp) { | 13242 | if (hp) { |
13236 | hp = concat_path_file(hp, ".ash_history"); | 13243 | hp = concat_path_file(hp, ".ash_history"); |
13237 | setvar("HISTFILE", hp, 0); | 13244 | setvar("HISTFILE", hp, 0); |
13238 | free((char*)hp); | 13245 | free((char*)hp); |