Dennis Groenen deee356a62 lineedit: histfile can get emptied when CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
When CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is set to y, the histfile
will get cleared if the total amount of history lines is less than MAX_HISTORY.
Only if the histfile is not empty _and_ the amount of lines currently
in memory are equal to or greater than MAX_HISTORY, history saving will
work as expected with this feature enabled.

Output from defconfig + CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y:
$ echo "foo" > ~/.ash_history
$ ./busybox ash
~/busybox/a $ echo "bar" > /dev/null
~/busybox/a $ exit
$ cat ~/.ash_history
$

Output with the patch applied and same config as above:
$ echo "foo" > ~/.ash_history
$ ./busybox ash
~/busybox/b $ echo "bar" > /dev/null
~/busybox/b $ exit
$ cat ~/.ash_history
foo
echo "bar" > /dev/null
exit
$

Signed-off-by: Dennis Groenen <tj.groenen at gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-26 11:19:38 +02:00
..
2012-03-22 11:15:06 +01:00
2011-09-13 14:59:06 +02:00
2011-02-03 00:05:48 +01:00
2010-10-28 18:57:19 +02:00
2011-08-10 00:51:29 +02:00
2011-08-28 05:31:49 +02:00
2010-10-28 18:57:19 +02:00
2011-09-08 10:59:26 +02:00
2011-07-08 08:34:28 +02:00
2010-10-28 18:57:19 +02:00
2011-05-16 12:21:31 +02:00
2010-10-28 18:57:19 +02:00
2010-10-28 18:57:19 +02:00
2011-09-07 22:19:46 +02:00
2011-02-10 10:01:49 +01:00
2011-07-08 08:34:28 +02:00
2010-10-28 18:57:19 +02:00
2011-03-12 02:19:50 +01:00
2010-07-26 01:49:12 +02:00
2010-10-19 23:07:49 +02:00
2010-10-29 11:46:52 +02:00
2010-10-28 18:57:19 +02:00
2011-02-12 01:56:25 +01:00
2011-01-17 14:23:42 +01:00
2011-08-28 05:31:49 +02:00
2010-11-03 02:48:43 +01:00
2011-01-25 23:21:46 +01:00
2011-10-28 16:15:00 +02:00
2011-10-24 04:06:18 +02:00
2010-10-28 18:57:19 +02:00
2010-10-28 18:57:19 +02:00
2010-10-28 18:57:19 +02:00

Please see the LICENSE file for copyright information (GPLv2)

libbb is BusyBox's utility library.  All of this stuff used to be stuffed into
a single file named utility.c.  When I split utility.c to create libbb, some of
the very oldest stuff ended up without their original copyright and licensing
information (which is now lost in the mists of time).  If you see something
that you wrote that is mis-attributed, do let me know so we can fix that up.

	Erik Andersen
	<andersen@codepoet.org>