Ignore:
Timestamp:
Apr 8, 2001, 9:17:16 AM (24 years ago)
Author:
umoeller
Message:

misc changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/stringh.c

    r55 r56  
    9292 *      Besides, this is guaranteed to only return -1, 0,
    9393 *      or +1, while strcmp can return any positive or
    94  *      negative value.
     94 *      negative value. This is useful for tree comparison
     95 *      funcs.
    9596 *
    9697 *@@added V0.9.9 (2001-02-16) [umoeller]
     
    102103    {
    103104        int i = strcmp(p1, p2);
     105        if (i < 0) return (-1);
     106        if (i > 0) return (+1);
     107    }
     108    else if (p1)
     109        // but p2 is NULL: p1 greater than p2 then
     110        return (+1);
     111    else if (p2)
     112        // but p1 is NULL: p1 less than p2 then
     113        return (-1);
     114
     115    // return 0 if strcmp returned 0 above or both strings are NULL
     116    return (0);
     117}
     118
     119/*
     120 *@@ strhicmp:
     121 *      like strhcmp, but compares without respect
     122 *      to case.
     123 *
     124 *@@added V0.9.9 (2001-04-07) [umoeller]
     125 */
     126
     127int strhicmp(const char *p1, const char *p2)
     128{
     129    if (p1 && p2)
     130    {
     131        int i = stricmp(p1, p2);
    104132        if (i < 0) return (-1);
    105133        if (i > 0) return (+1);
Note: See TracChangeset for help on using the changeset viewer.