Patch from vodz to fix the dynamic vars patch, which I should not

have checked in.  Vladimir writes:

Your patch have many problem.
1. You always added + time(). This cannot reset RANDOM=value for debuging
with
replay sequential.
2. Hmm. I examine bash 2.04 source. This pseudorandom generator use low bits
of
counter value. You use high bits. This make bad pseudorandom values after
have
0-value. For example, if + time() do remove, your generator always return 0
after
first generate 0.
3. Memory leak per call. Use ash-unlike unecessary bb_strdup function.
4. Unsupport show last $RANDOM value for "set" and "export" command.
5. Bloat code. Busybox-unlike patch - added unstandart feature as default
hardcode.

Last patch attached.

Erik, why you apply Paul patch with have 5-th point problem? :(

Last patch have ash change xwrite() to fresh libbb/bb_full_write interfase
(haved loop after EINTR).


--w
vodz
This commit is contained in:
Eric Andersen
2004-03-16 05:14:10 +00:00
parent ca65ca7d45
commit 16767e2377
2 changed files with 97 additions and 75 deletions

View File

@@ -97,6 +97,17 @@ config CONFIG_ASH_OPTIMIZE_FOR_SIZE
help
Compile ash for reduced size at price of speed.
config CONFIG_ASH_RANDOM_SUPPORT
bool " Enable pseudorandom generator and variable $RANDOM"
default n
depends on CONFIG_ASH
help
Enable pseudorandom generator and dynamic variable "$RANDOM".
Each read of "$RANDOM" will generate a new pseudorandom value.
You can reset the generator by using a specified start value.
After "unset RANDOM" then generator will switch off and this
variable will no longer have special treatment.
config CONFIG_HUSH
bool "hush"
default n