diff options
author | Daniel LEVAI <leva@ecentrum.hu> | 2011-06-01 00:18:19 -0400 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-06-13 01:33:41 -0400 |
commit | 903c9bfaeab1d551cfa75e25d6eff958db062178 (patch) | |
tree | 2c60c0495578340340223c65d4eb04d3dc40d6c2 /system/ksh/patches/linux/var_c.diff | |
parent | 1a42fa75cf0fd8923db484989e8cbea947bb2aee (diff) | |
download | slackbuilds-903c9bfaeab1d551cfa75e25d6eff958db062178.tar.gz |
system/ksh: Updated for version openbsd49.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'system/ksh/patches/linux/var_c.diff')
-rw-r--r-- | system/ksh/patches/linux/var_c.diff | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/system/ksh/patches/linux/var_c.diff b/system/ksh/patches/linux/var_c.diff new file mode 100644 index 0000000000..9483a3b4ce --- /dev/null +++ b/system/ksh/patches/linux/var_c.diff @@ -0,0 +1,53 @@ +--- ksh-openbsd_cvs/var.c 2010-02-23 12:49:23.000000000 +0100 ++++ ksh-openbsd_cvs.new/var.c 2010-04-01 21:01:24.145380963 +0200 +@@ -5,6 +5,7 @@ + #include "ksh_limval.h" + #include <sys/stat.h> + #include <ctype.h> ++#include "strlcpy.h" + + /* + * Variables +@@ -865,12 +866,6 @@ makenv(void) + } + + /* +- * Someone has set the srand() value, therefore from now on +- * we return values from rand() instead of arc4random() +- */ +-int use_rand = 0; +- +-/* + * Called after a fork in parent to bump the random number generator. + * Done to ensure children will not get the same random number sequence + * if the parent doesn't use $RANDOM. +@@ -878,8 +873,7 @@ int use_rand = 0; + void + change_random(void) + { +- if (use_rand) +- rand(); ++ rand(); + } + + /* +@@ -926,10 +920,7 @@ getspec(struct tbl *vp) + break; + case V_RANDOM: + vp->flag &= ~SPECIAL; +- if (use_rand) +- setint(vp, (long) (rand() & 0x7fff)); +- else +- setint(vp, (long) (arc4random() & 0x7fff)); ++ setint(vp, (long) (rand() & 0x7fff)); + vp->flag |= SPECIAL; + break; + #ifdef HISTORY +@@ -1030,7 +1021,6 @@ setspec(struct tbl *vp) + case V_RANDOM: + vp->flag &= ~SPECIAL; + srand((unsigned int)intval(vp)); +- use_rand = 1; + vp->flag |= SPECIAL; + break; + case V_SECONDS: |