Index: /trunk/src/emx/src/lib/bsd/stdlib/radixsort.c
===================================================================
--- /trunk/src/emx/src/lib/bsd/stdlib/radixsort.c	(revision 1691)
+++ /trunk/src/emx/src/lib/bsd/stdlib/radixsort.c	(revision 1692)
@@ -40,5 +40,5 @@
 #include "libc-alias.h" /* bird: Get the right mapping of libc functions. */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/radixsort.c,v 1.6 2002/03/22 09:18:34 obrien Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/radixsort.c,v 1.7 2003/11/11 04:59:23 kientzle Exp $");
 
 /*
@@ -179,4 +179,15 @@
 
 		/*
+		 * Special case: if all strings have the same
+		 * character at position i, move on to the next
+		 * character.
+		 */
+		if (nc == 1 && count[bmin] == n) {
+			push(a, n, i+1);
+			nc = count[bmin] = 0;
+			continue;
+		}
+
+		/*
 		 * Set top[]; push incompletely sorted bins onto stack.
 		 * top[] = pointers to last out-of-place element in bins.
Index: /trunk/src/emx/src/lib/bsd/stdlib/random.c
===================================================================
--- /trunk/src/emx/src/lib/bsd/stdlib/random.c	(revision 1691)
+++ /trunk/src/emx/src/lib/bsd/stdlib/random.c	(revision 1692)
@@ -35,11 +35,11 @@
 static char sccsid[] = "@(#)random.c	8.2 (Berkeley) 5/19/95";
 #endif /* LIBC_SCCS and not lint */
-#include "libc-alias.h" /* bird: Get the right mapping of libc functions. */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/random.c,v 1.22 2003/02/04 11:24:08 ache Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/random.c,v 1.24 2004/01/20 03:02:18 das Exp $");
 
 #include "namespace.h"
 #include <sys/time.h>          /* for srandomdev() */
 #include <fcntl.h>             /* for srandomdev() */
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -63,8 +63,8 @@
  * 32 bytes, a simple linear congruential R.N.G. is used.
  *
- * Internally, the state information is treated as an array of longs; the
+ * Internally, the state information is treated as an array of uint32_t's; the
  * zeroeth element of the array is the type of R.N.G. being used (small
  * integer); the remainder of the array is the state information for the
- * R.N.G.  Thus, 32 bytes of state information will give 7 longs worth of
+ * R.N.G.  Thus, 32 bytes of state information will give 7 ints worth of
  * state information, which will allow a degree seven polynomial.  (Note:
  * the zeroeth word of state information also has some other information
@@ -144,8 +144,12 @@
 #define	MAX_TYPES	5		/* max number of types above */
 
-#define NSHUFF 100      /* to drop part of seed -> 1st value correlation */
-
-static long degrees[MAX_TYPES] =	{ DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
-static long seps [MAX_TYPES] =	{ SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
+#ifdef  USE_WEAK_SEEDING
+#define NSHUFF 0
+#else   /* !USE_WEAK_SEEDING */
+#define NSHUFF 50       /* to drop some "seed -> 1st value" linearity */
+#endif  /* !USE_WEAK_SEEDING */
+
+static const int degrees[MAX_TYPES] =	{ DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
+static const int seps [MAX_TYPES] =	{ SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
 
 /*
@@ -163,5 +167,5 @@
  */
 
-static long randtbl[DEG_3 + 1] = {
+static uint32_t randtbl[DEG_3 + 1] = {
 	TYPE_3,
 #ifdef  USE_WEAK_SEEDING
@@ -198,6 +202,6 @@
  * to point to randtbl[1] (as explained below).
  */
-static long *fptr = &randtbl[SEP_3 + 1];
-static long *rptr = &randtbl[1];
+static uint32_t *fptr = &randtbl[SEP_3 + 1];
+static uint32_t *rptr = &randtbl[1];
 
 /*
@@ -211,14 +215,14 @@
  * the last element to see if the front and rear pointers have wrapped.
  */
-static long *state = &randtbl[1];
-static long rand_type = TYPE_3;
-static long rand_deg = DEG_3;
-static long rand_sep = SEP_3;
-static long *end_ptr = &randtbl[DEG_3 + 1];
-
-static inline long good_rand(long);
-
-static inline long good_rand (x)
-	long x;
+static uint32_t *state = &randtbl[1];
+static int rand_type = TYPE_3;
+static int rand_deg = DEG_3;
+static int rand_sep = SEP_3;
+static uint32_t *end_ptr = &randtbl[DEG_3 + 1];
+
+static inline uint32_t good_rand(int32_t);
+
+static inline uint32_t good_rand (x)
+	int32_t x;
 {
 #ifdef  USE_WEAK_SEEDING
@@ -238,5 +242,5 @@
  * October 1988, p. 1195.
  */
-	long hi, lo;
+	int32_t hi, lo;
 
 	/* Can't be initialized with 0, so use another value. */
@@ -265,10 +269,10 @@
  */
 void
-srandom(x)
+_STD(srandom)(x)
 	unsigned long x;
 {
-	long i, lim;
-
-	state[0] = x;
+	int i, lim;
+
+	state[0] = (uint32_t)x;
 	if (rand_type == TYPE_0)
 		lim = NSHUFF;
@@ -348,10 +352,10 @@
  * Returns a pointer to the old state.
  *
- * Note: The Sparc platform requires that arg_state begin on a long
+ * Note: The Sparc platform requires that arg_state begin on an int
  * word boundary; otherwise a bus error will occur. Even so, lint will
  * complain about mis-alignment, but you should disregard these messages.
  */
 char *
-initstate(seed, arg_state, n)
+_STD(initstate)(seed, arg_state, n)
 	unsigned long seed;		/* seed for R.N.G. */
 	char *arg_state;		/* pointer to state array */
@@ -359,5 +363,5 @@
 {
 	char *ostate = (char *)(&state[-1]);
-	long *long_arg_state = (long *) arg_state;
+	uint32_t *int_arg_state = (uint32_t *)arg_state;
 
 	if (rand_type == TYPE_0)
@@ -391,11 +395,11 @@
 		rand_sep = SEP_4;
 	}
-	state = (long *) (long_arg_state + 1); /* first location */
+	state = int_arg_state + 1; /* first location */
 	end_ptr = &state[rand_deg];	/* must set end_ptr before srandom */
 	srandom(seed);
 	if (rand_type == TYPE_0)
-		long_arg_state[0] = rand_type;
+		int_arg_state[0] = rand_type;
 	else
-		long_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type;
+		int_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type;
 	return(ostate);
 }
@@ -416,15 +420,15 @@
  * Returns a pointer to the old state information.
  *
- * Note: The Sparc platform requires that arg_state begin on a long
+ * Note: The Sparc platform requires that arg_state begin on an int
  * word boundary; otherwise a bus error will occur. Even so, lint will
  * complain about mis-alignment, but you should disregard these messages.
  */
 char *
-setstate(arg_state)
+_STD(setstate)(arg_state)
 	char *arg_state;		/* pointer to state array */
 {
-	long *new_state = (long *) arg_state;
-	long type = new_state[0] % MAX_TYPES;
-	long rear = new_state[0] / MAX_TYPES;
+	uint32_t *new_state = (uint32_t *)arg_state;
+	uint32_t type = new_state[0] % MAX_TYPES;
+	uint32_t rear = new_state[0] / MAX_TYPES;
 	char *ostate = (char *)(&state[-1]);
 
@@ -447,5 +451,5 @@
 		    "random: state info corrupted; not changed.\n");
 	}
-	state = (long *) (new_state + 1);
+	state = new_state + 1;
 	if (rand_type != TYPE_0) {
 		rptr = &state[rear];
@@ -474,8 +478,8 @@
  */
 long
-random()
+_STD(random)()
 {
-	long i;
-	long *f, *r;
+	uint32_t i;
+	uint32_t *f, *r;
 
 	if (rand_type == TYPE_0) {
@@ -499,4 +503,4 @@
 		fptr = f; rptr = r;
 	}
-	return(i);
+	return((long)i);
 }
