On Sunday 03 March 2013 15:29, Stefan Hellermann wrote:
> move HISTFILE=$HOME/.ash_history below reading /etc/profile,
> so that /etc/profile can set $HOME. HOME can be unset when
> directly invoking ash --login from init without going through
> getty.
Does hush also suffer from this?
> @@ -13243,6 +13230,15 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
> #if MAX_HISTORY > 0 && ENABLE_FEATURE_EDITING_SAVEHISTORY
> if (iflag) {
> const char *hp = lookupvar("HISTFILE");
> + if (!hp) {
> + hp = lookupvar("HOME");
> + if(hp) {
> + hp = concat_path_file(hp,
> ".ash_history");
> + setvar("HISTFILE", hp, 0);
> + free(hp);
free(const char*) throws a warning.
> + hp = lookupvar("HISTFILE");
> + }
> + }
> if (hp)
> line_input_state->hist_file = hp;
Applied, thanks!
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox