diff options
author | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-30 00:30:44 +0000 |
---|---|---|
committer | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-30 00:30:44 +0000 |
commit | d7ce700605e1af0e455e31ec11f19ff21d26b525 (patch) | |
tree | 243b582ac3350e8c6ce6ca96fff13805318fd65c /StdLib/LibC/String/Comparison.c | |
parent | f766dd76fde231ecd4f2e9faf99293e90902cebb (diff) | |
download | edk2-platforms-d7ce700605e1af0e455e31ec11f19ff21d26b525.tar.xz |
Add Socket Libraries.
Add Posix functions for porting compatibility.
Fix compliance issues with ISO/IEC 9899:199409
New Functions:
setenv(), fparseln(), GetFileNameFromPath(), rename(),
realpath(), setprogname(), getprogname(), strlcat(), strlcpy(),
strsep(), setitimer(), getitimer(), timegm(), getopt(), basename(),
mkstemp(), ffs(), vsnprintf(), snprintf(), getpass(), usleep(), select(),
writev(), strcasecmp(), getcwd(), chdir(), tcgetpgrp(), getpgrp(), gettimeofday(),
bcopy(),
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12061 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC/String/Comparison.c')
-rw-r--r-- | StdLib/LibC/String/Comparison.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/StdLib/LibC/String/Comparison.c b/StdLib/LibC/String/Comparison.c index e656fe73f5..b4980c7c1e 100644 --- a/StdLib/LibC/String/Comparison.c +++ b/StdLib/LibC/String/Comparison.c @@ -109,10 +109,15 @@ strcasecmp(const char *s1, const char *s2) {
const unsigned char *us1 = (const unsigned char *)s1,
*us2 = (const unsigned char *)s2;
+ int Difference;
- while (tolower(*us1) == tolower(*us2++))
- if (*us1++ == '\0')
+ while ( 0 == ( Difference = tolower(*us1) - tolower(*us2))) {
+ if (*us1 == 0) {
return (0);
- return (tolower(*us1) - tolower(*--us2));
+ }
+ us1 += 1;
+ us2 += 1;
+ }
+ return Difference;
}
|