/[cvs]/ccvs/lib/strcasecmp.c
ViewVC logotype

Diff of /ccvs/lib/strcasecmp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by dprice, Sun Sep 4 05:58:56 2005 UTC revision 1.4 by dprice, Thu Oct 20 21:06:01 2005 UTC
# Line 25  Line 25 
25  #include "strcase.h"  #include "strcase.h"
26    
27  #include <ctype.h>  #include <ctype.h>
28    #include <limits.h>
29    
30  #if HAVE_MBRTOWC  #if HAVE_MBRTOWC
31  # include "mbuiter.h"  # include "mbuiter.h"
# Line 93  strcasecmp (const char *s1, const char * Line 94  strcasecmp (const char *s1, const char *
94          }          }
95        while (c1 == c2);        while (c1 == c2);
96    
97        return c1 - c2;        if (UCHAR_MAX <= INT_MAX)
98            return c1 - c2;
99          else
100            /* On machines where 'char' and 'int' are types of the same size, the
101               difference of two 'unsigned char' values - including the sign bit -
102               doesn't fit in an 'int'.  */
103            return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
104      }      }
105  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26