Coverage Report

Created: 2025-07-04 06:49

/src/cpython/Python/pystrcmp.c
Line
Count
Source (jump to first uncovered line)
1
/* Cross platform case insensitive string compare functions
2
 */
3
4
#include "Python.h"
5
6
int
7
PyOS_mystrnicmp(const char *s1, const char *s2, Py_ssize_t size)
8
0
{
9
0
    const unsigned char *p1, *p2;
10
0
    if (size == 0)
11
0
        return 0;
12
0
    p1 = (const unsigned char *)s1;
13
0
    p2 = (const unsigned char *)s2;
14
0
    for (; (--size > 0) && *p1 && *p2 && (Py_TOLOWER(*p1) == Py_TOLOWER(*p2));
15
0
         p1++, p2++) {
16
0
        ;
17
0
    }
18
0
    return Py_TOLOWER(*p1) - Py_TOLOWER(*p2);
19
0
}
20
21
int
22
PyOS_mystricmp(const char *s1, const char *s2)
23
0
{
24
0
    const unsigned char *p1 = (const unsigned char *)s1;
25
0
    const unsigned char *p2 = (const unsigned char *)s2;
26
0
    for (; *p1 && *p2 && (Py_TOLOWER(*p1) == Py_TOLOWER(*p2)); p1++, p2++) {
27
0
        ;
28
0
    }
29
0
    return (Py_TOLOWER(*p1) - Py_TOLOWER(*p2));
30
0
}