summaryrefslogtreecommitdiff
path: root/src/flstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/flstring.c')
-rw-r--r--src/flstring.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/flstring.c b/src/flstring.c
index 3bab28ca0..c6f2825d7 100644
--- a/src/flstring.c
+++ b/src/flstring.c
@@ -97,20 +97,18 @@ fl_strlcpy(char *dst, /* O - Destination string */
#define C_RANGE(c,l,r) ( (c) >= (l) && (c) <= (r) )
int fl_ascii_strcasecmp(const char *s, const char *t) {
- if (!s || !t) return (s!=t);
- size_t sl=strlen(s), tl=strlen(t);
-
- for(;*s && *t; s++,t++) {
- if (*s == *t) continue;
- if (*s < *t) {
- if ( (*s+0x20)!=*t || !C_RANGE(*s,'A','Z') ) return -1;
- } else { // *s > *t
- if ( (*s-0x20)!=*t || !C_RANGE(*s,'a','z') ) return +1;
- }
- }
- if (sl!=tl) return sl< tl ? -1 : +1;
-
- return 0;
+ if (!s || !t) return (s!=t);
+ size_t sl=strlen(s), tl=strlen(t);
+
+ for(;*s && *t; s++,t++) {
+ if (*s == *t) continue;
+ if (*s < *t) {
+ if ( (*s+0x20)!=*t || !C_RANGE(*s,'A','Z') ) return -1;
+ } else { // *s > *t
+ if ( (*s-0x20)!=*t || !C_RANGE(*s,'a','z') ) return +1;
+ }
+ }
+ return (sl==tl) ? 0 : (sl< tl ? -1 : +1);
}
/*