Changeset 56 for trunk/src/helpers/stringh.c
- Timestamp:
- Apr 8, 2001, 9:17:16 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/stringh.c
r55 r56 92 92 * Besides, this is guaranteed to only return -1, 0, 93 93 * or +1, while strcmp can return any positive or 94 * negative value. 94 * negative value. This is useful for tree comparison 95 * funcs. 95 96 * 96 97 *@@added V0.9.9 (2001-02-16) [umoeller] … … 102 103 { 103 104 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 127 int strhicmp(const char *p1, const char *p2) 128 { 129 if (p1 && p2) 130 { 131 int i = stricmp(p1, p2); 104 132 if (i < 0) return (-1); 105 133 if (i > 0) return (+1);
Note:
See TracChangeset
for help on using the changeset viewer.