mirror of
https://github.com/chatmail/core.git
synced 2026-05-23 00:36:32 +03:00
Remove unused `dc_str_contains' function
This commit is contained in:
@@ -178,29 +178,6 @@ pub unsafe fn dc_strlower_in_place(in_0: *mut libc::c_char) {
|
|||||||
memcpy(in_0 as *mut _, raw.as_ptr() as *const _, strlen(in_0));
|
memcpy(in_0 as *mut _, raw.as_ptr() as *const _, strlen(in_0));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_str_contains(
|
|
||||||
haystack: *const libc::c_char,
|
|
||||||
needle: *const libc::c_char,
|
|
||||||
) -> libc::c_int {
|
|
||||||
if haystack.is_null() || needle.is_null() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if !strstr(haystack, needle).is_null() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
let haystack_lower: *mut libc::c_char = dc_strlower(haystack);
|
|
||||||
let needle_lower: *mut libc::c_char = dc_strlower(needle);
|
|
||||||
let ret = if !strstr(haystack_lower, needle_lower).is_null() {
|
|
||||||
1
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
};
|
|
||||||
free(haystack_lower as *mut libc::c_void);
|
|
||||||
free(needle_lower as *mut libc::c_void);
|
|
||||||
|
|
||||||
ret
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the result must be free()'d */
|
/* the result must be free()'d */
|
||||||
pub unsafe fn dc_null_terminate(
|
pub unsafe fn dc_null_terminate(
|
||||||
in_0: *const libc::c_char,
|
in_0: *const libc::c_char,
|
||||||
|
|||||||
Reference in New Issue
Block a user