diff options
-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); |