brand ()
{
rseed = rseed * 1103515245 + 12345;
+#if 0
return ((unsigned int)(rseed / 65536) % 32768);
+#else
+ return ((unsigned int)(rseed % 32768));
+#endif
}
/* Set the random number generator seed to SEED. */
int seed;
{
rseed = seed;
+ last_random_value = 0;
}
static SHELL_VAR *
/* Reset for command and process substitution. */
if (subshell_environment)
- sbrand ((int)(getpid() + NOW));
+ sbrand (rseed + (int)(getpid() + NOW));
do
rv = brand ();
}
else if (array_p (var) == 0)
var = convert_var_to_array (var);
+#if 0
+ else
+ empty_array (array_cell (var));
+#endif
return (assign_array_var_from_string (var, value));
}
else
nlist = expand_string (value, 0);
+#if 1
+ /* Now that we are ready to assign values to the array, kill the existing
+ value. */
+ if (a)
+ empty_array (a);
+#endif
+
for (last_ind = 0, list = nlist; list; list = list->next)
{
w = list->word->word;