diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 8bd0ce01c6e0c1abe2b5d1e0dbca273d353f9103..9509f89953d9536fa25e10af60b9a606671c2c90 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-22  Ben Elliston  <bje@gnu.org>
+
+	* regex.c (regcomp): Change type of `i' from unsigned to int.
+
 2005-07-22  Ben Elliston  <bje@gnu.org>
 
 	Recover patch lost in the sourceware repository:
diff --git a/libiberty/regex.c b/libiberty/regex.c
index 951f2d10f33a8c969984bbe35e0d0d57e0979ece..fa1df197ce9dbdcc6da0da0196896c643bdaf807 100644
--- a/libiberty/regex.c
+++ b/libiberty/regex.c
@@ -7923,7 +7923,7 @@ regcomp (regex_t *preg, const char *pattern, int cflags)
 
   if (cflags & REG_ICASE)
     {
-      unsigned i;
+      int i;
 
       preg->translate
 	= (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
@@ -7933,7 +7933,7 @@ regcomp (regex_t *preg, const char *pattern, int cflags)
 
       /* Map uppercase characters to corresponding lowercase ones.  */
       for (i = 0; i < CHAR_SET_SIZE; i++)
-        preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : (int) i;
+        preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i;
     }
   else
     preg->translate = NULL;