[PATCH] ash: make EPOCH variables work if RANDOM is disabled

Denys Vlasenko vda.linux at googlemail.com
Wed Mar 29 14:47:11 UTC 2023


Applied, thank you.

On Sun, Mar 26, 2023 at 12:21 PM Ron Yorston <rmy at pobox.com> wrote:
>
> Commit 1d37186fe2 (ash: add bash-compatible EPOCH variables) added
> support for the EPOCHSECONDS and EPOCHREALTIME variables.
>
> These variables are dynamic and therefore require the VDYNAMIC flag
> to be non-zero.  However, this is only the case if support for the
> RANDOM variable is enabled.
>
> Give VDYNAMIC a non-zero value if either EPOCH variables or RANDOM
> are enabled.
>
> Signed-off-by: Ron Yorston <rmy at pobox.com>
> ---
>  shell/ash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/shell/ash.c b/shell/ash.c
> index 5f8c8ea19..559566b58 100644
> --- a/shell/ash.c
> +++ b/shell/ash.c
> @@ -2087,7 +2087,7 @@ struct localvar {
>  #define VNOFUNC         0x40    /* don't call the callback function */
>  #define VNOSET          0x80    /* do not set variable - just readonly test */
>  #define VNOSAVE         0x100   /* when text is on the heap before setvareq */
> -#if ENABLE_ASH_RANDOM_SUPPORT
> +#if ENABLE_ASH_RANDOM_SUPPORT || BASH_EPOCH_VARS
>  # define VDYNAMIC       0x200   /* dynamic variable */
>  #else
>  # define VDYNAMIC       0
> --
> 2.39.2
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list