Imported from ../bash-2.01.1.tar.gz.
[platform/upstream/bash.git] / oslib.c
diff --git a/oslib.c b/oslib.c
index ef643ff..bc49fff 100644 (file)
--- a/oslib.c
+++ b/oslib.c
@@ -105,14 +105,14 @@ strrchr (string, c)
 #if !defined (HAVE_STRCASECMP)
 
 #if !defined (to_lower)
-#  define to_lower(c) (islower(c) ? (c) : toupper(c))
+#  define to_lower(c) (islower(c) ? (c) : tolower(c))
 #endif /* to_lower */
 
 /* Compare at most COUNT characters from string1 to string2.  Case
    doesn't matter. */
 int
 strncasecmp (string1, string2, count)
-     char *string1, *string2;
+     const char *string1, *string2;
      int count;
 {
   register char *s1, *s2;
@@ -120,8 +120,8 @@ strncasecmp (string1, string2, count)
 
   if (count > 0)
     {
-      s1 = string1;
-      s2 = string2;
+      s1 = (char *)string1;
+      s2 = (char *)string2;
       do
        {
          if ((r = to_lower (*s1) - to_lower (*s2)) != 0)
@@ -138,13 +138,13 @@ strncasecmp (string1, string2, count)
 /* strcmp (), but caseless. */
 int
 strcasecmp (string1, string2)
-     char *string1, *string2;
+     const char *string1, *string2;
 {
   register char *s1, *s2;
   register int r;
 
-  s1 = string1;
-  s2 = string2;
+  s1 = (char *)string1;
+  s2 = (char *)string2;
 
   while ((r = to_lower (*s1) - to_lower (*s2)) == 0)
     {
@@ -280,9 +280,10 @@ bzero (s, n)
      int n;
 {
   register int i;
+  register char *r;
 
-  for (i = 0; i < n; i++)
-    s[i] = '\0';
+  for (i = 0, r = s; i < n; i++)
+    *r++ = '\0';
 }
 #endif