Am 02.03.2013 16:28, schrieb Stefan Hellermann:
> 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.
>
> Signed-off-by: Stefan Hellermann <[email protected]>
>
> diff --git a/shell/ash.c b/shell/ash.c
> index 7c91a77..96ec1a1 100644
> --- a/shell/ash.c
> +++ b/shell/ash.c
> @@ -13198,7 +13198,10 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
> read_profile("/etc/profile");
> state1:
> state = 2;
> - read_profile(".profile");
> + const char *hp = lookupvar("HOME");
> + hp = concat_path_file(hp, ".profile");
> + read_profile(hp);
> + free(hp);
> }
> state2:
> state = 3;
This is a good point :)
NTL the code (reading histfile) assumed that HOME can be empty.
can you save drop this assumption here ?
btw:
i noticed that cdcmd() uses bltinlookup("HOME") while else lookupvar("HOME")
is used. Can someone tell me why the difference ?
re,
wh
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox