| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/lib/sh/mbschr.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | extern int locale_mb_cur_max; | - | ||||||||||||||||||
| 7 | extern int locale_utf8locale; | - | ||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | static inline char * | - | ||||||||||||||||||
| 12 | utf8_mbschr (s, c) | - | ||||||||||||||||||
| 13 | const char *s; | - | ||||||||||||||||||
| 14 | int c; | - | ||||||||||||||||||
| 15 | { | - | ||||||||||||||||||
| 16 | return executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 17 | (__extension__ (__builtin_constant_p ( executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 18 | c executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 19 | ) && !__builtin_constant_p ( executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 20 | s executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 21 | ) && ( executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 22 | c executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 23 | ) == '\0' ? (char *) __rawmemchr ( executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 24 | s executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 25 | , executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 26 | c executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 27 | ) : __builtin_strchr ( executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 28 | s executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 29 | , executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 30 | c executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 31 | ))) executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 32 | ; executed 361596937 times by 1 test: return (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) ;Executed by:
| 361596937 | ||||||||||||||||||
| 33 | } | - | ||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | - | |||||||||||||||||||
| 37 | - | |||||||||||||||||||
| 38 | - | |||||||||||||||||||
| 39 | char * | - | ||||||||||||||||||
| 40 | - | |||||||||||||||||||
| 41 | mbschr (const char *s, int c) | - | ||||||||||||||||||
| 42 | - | |||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | { | - | ||||||||||||||||||
| 48 | - | |||||||||||||||||||
| 49 | char *pos; | - | ||||||||||||||||||
| 50 | mbstate_t state; | - | ||||||||||||||||||
| 51 | size_t strlength, mblength; | - | ||||||||||||||||||
| 52 | - | |||||||||||||||||||
| 53 | if (locale_utf8locale
| 1056788-363901577 | ||||||||||||||||||
| 54 | return executed 361596937 times by 1 test: (utf8_mbschr (s, c));return (utf8_mbschr (s, c));Executed by:
executed 361596937 times by 1 test: return (utf8_mbschr (s, c));Executed by:
| 361596937 | ||||||||||||||||||
| 55 | - | |||||||||||||||||||
| 56 | - | |||||||||||||||||||
| 57 | - | |||||||||||||||||||
| 58 | - | |||||||||||||||||||
| 59 | - | |||||||||||||||||||
| 60 | if ((
| 45404-3316024 | ||||||||||||||||||
| 61 | { | - | ||||||||||||||||||
| 62 | pos = (char *)s; | - | ||||||||||||||||||
| 63 | memset (&state, '\0', sizeof(mbstate_t)); | - | ||||||||||||||||||
| 64 | strlength = strlen (s); | - | ||||||||||||||||||
| 65 | - | |||||||||||||||||||
| 66 | while (strlength > 0
| 2304640-23046400 | ||||||||||||||||||
| 67 | { | - | ||||||||||||||||||
| 68 | if (is_basic (*pos)
| 2304640-20741760 | ||||||||||||||||||
| 69 | mblength = 1; executed 20741760 times by 1 test: mblength = 1;Executed by:
| 20741760 | ||||||||||||||||||
| 70 | else | - | ||||||||||||||||||
| 71 | { | - | ||||||||||||||||||
| 72 | mblength = mbrlen (pos, strlength, &state); | - | ||||||||||||||||||
| 73 | if (mblength == (size_t)-2
| 0-2304640 | ||||||||||||||||||
| 74 | mblength = 1; never executed: mblength = 1; | 0 | ||||||||||||||||||
| 75 | } executed 2304640 times by 1 test: end of blockExecuted by:
| 2304640 | ||||||||||||||||||
| 76 | - | |||||||||||||||||||
| 77 | if (mblength == 1
| 0-23046400 | ||||||||||||||||||
| 78 | return never executed: pos;return pos;never executed: return pos; | 0 | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | strlength -= mblength; | - | ||||||||||||||||||
| 81 | pos += mblength; | - | ||||||||||||||||||
| 82 | } executed 23046400 times by 1 test: end of blockExecuted by:
| 23046400 | ||||||||||||||||||
| 83 | - | |||||||||||||||||||
| 84 | return executed 2304640 times by 1 test: ((char *)return ((char *) ((void *)0) );Executed by:
executed 2304640 times by 1 test: return ((char *) ((void *)0) );Executed by:
| 2304640 | ||||||||||||||||||
| 85 | ((void *)0) executed 2304640 times by 1 test: return ((char *) ((void *)0) );Executed by:
| 2304640 | ||||||||||||||||||
| 86 | ); executed 2304640 times by 1 test: return ((char *) ((void *)0) );Executed by:
| 2304640 | ||||||||||||||||||
| 87 | } | - | ||||||||||||||||||
| 88 | else | - | ||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | return executed 1056788 times by 1 test: (return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 91 | (__extension__ (__builtin_constant_p ( executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 92 | c executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 93 | ) && !__builtin_constant_p ( executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 94 | s executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 95 | ) && ( executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 96 | c executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 97 | ) == '\0' ? (char *) __rawmemchr ( executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 98 | s executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 99 | , executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 100 | c executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 101 | ) : __builtin_strchr ( executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 102 | s executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 103 | , executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 104 | c executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 105 | ))) executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 106 | ); executed 1056788 times by 1 test: return ( (__extension__ (__builtin_constant_p ( c ) && !__builtin_constant_p ( s ) && ( c ) == '\0' ? (char *) __rawmemchr ( s , c ) : __builtin_strchr ( s , c ))) );Executed by:
| 1056788 | ||||||||||||||||||
| 107 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |