| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/lib/sh/casemod.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | extern char *substring (char *, int, int); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | static wchar_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | cval (s, i) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | char *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | size_t tmp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | wchar_t wc; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | int l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | mbstate_t mps; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | if ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | (
| 0-1663 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | == 1
| 0-1663 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | return executed 1663 times by 1 test: ((wchar_t)s[i]);return ((wchar_t)s[i]);Executed by:
executed 1663 times by 1 test: return ((wchar_t)s[i]);Executed by:
| 1663 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | l = strlen (s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | if (i >= (l - 1)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | return never executed: ((wchar_t)s[i]);return ((wchar_t)s[i]);never executed: return ((wchar_t)s[i]); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | memset (&mps, 0, sizeof (mbstate_t)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | tmp = mbrtowc (&wc, s + i, l - i, &mps); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | if (((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | return never executed: ((wchar_t)s[i]);return ((wchar_t)s[i]);never executed: return ((wchar_t)s[i]); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | return never executed: wc;return wc;never executed: return wc; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | char * | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | sh_modcase (string, pat, flags) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | const char *string; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | char *pat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | int flags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | int start, next, end, retind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | int inword, c, nc, nop, match, usewords; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | char *ret, *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | wchar_t wc; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | int mb_cur_max; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | wchar_t nwc; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | char mb[ | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 16 | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | +1]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | int mlen; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | size_t m; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | mbstate_t state; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | if (string == 0
| 0-149 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | ret = (char *)sh_xmalloc((1), "casemod.c", 123); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | ret[0] = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | return executed 21 times by 1 test: ret;return ret;Executed by:
executed 21 times by 1 test: return ret;Executed by:
| 21 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | memset (&state, 0, sizeof (mbstate_t)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | start = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | end = strlen (string); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | mb_cur_max = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | (__ctype_get_mb_cur_max ()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | ret = (char *)sh_xmalloc((2*end + 1), "casemod.c", 136); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | retind = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | usewords = (flags & 0x1000); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | flags &= ~0x1000; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | inword = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | while (start < end
| 128-1663 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | wc = cval ((char *)string, start); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | if (iswalnum (wc) == 0
| 118-1545 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | inword = 0; executed 118 times by 1 test: inword = 0;Executed by:
| 118 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | if (pat
| 622-1041 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | next = start; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | do { if (locale_mb_cur_max > 1
executed 622 times by 1 test: else if (locale_utf8localemblength = 1;Executed by:
never executed: else { state_bak = state; mblength = mbrlen ((string) + (next), (end) - (next), &state); }mblength = 1;never executed: if (mblength == (size_t)-2end of block
never executed: else if (mblength == 0end of block
never executed: next)++;(next)++;never executed: else ((next)++;executed 622 times by 1 test: next) += mblength;(next) += mblength;Executed by:
executed 622 times by 1 test: } else ((next) += mblength;Executed by:
never executed: next)++;(next)++;never executed: } while (0);(next)++; | 0-622 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | s = substring ((char *)string, start, next); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | match = strmatch (pat, s, (1 << 5)) != 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | sh_xfree((s), "casemod.c", 157); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | if (match == 0
| 254-368 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | memcpy (ret + retind, string + start, next - start); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | retind += next - start; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | start = next; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | inword = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | continue; executed 254 times by 1 test: continue;Executed by:
| 254 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } executed 368 times by 1 test: end of blockExecuted by:
| 368 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | if (flags == 0x0004
| 126-1283 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | if (usewords
| 0-126 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | nop = inword
never executed: nop = inword ? 0x0001 : 0x0002; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | nop = (
executed 126 times by 1 test: nop = (start > 0) ? 0x0001 : 0x0002;Executed by:
| 2-126 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | inword = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } executed 126 times by 1 test: end of blockExecuted by:
| 126 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | else if (flags == 0x0008
| 0-1283 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | if (usewords
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | nop = inword
never executed: nop = inword ? 0x0002 : 0x0001; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | nop = (
never executed: nop = (start > 0) ? 0x0002 : 0x0001; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | inword = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | else if (flags == 0x0040
| 297-986 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | if (usewords
| 0-297 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | nop = inword
never executed: nop = inword ? 0x0000 : 0x0002; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | nop = (
executed 297 times by 1 test: nop = (start > 0) ? 0x0000 : 0x0002;Executed by:
| 23-297 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | inword = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } executed 297 times by 1 test: end of blockExecuted by:
| 297 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | else if (flags == 0x0080
| 182-804 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | if (usewords
| 0-182 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | nop = inword
never executed: nop = inword ? 0x0000 : 0x0001; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | nop = (
executed 182 times by 1 test: nop = (start > 0) ? 0x0000 : 0x0001;Executed by:
| 12-182 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | inword = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } executed 182 times by 1 test: end of blockExecuted by:
| 182 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | else if (flags == 0x0010
| 15-789 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | nop = inword
| 1-14 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | inword = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } executed 15 times by 1 test: end of blockExecuted by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | nop = flags; executed 789 times by 1 test: nop = flags;Executed by:
| 789 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | if (mb_cur_max == 1
| 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | singlebyte: | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | switch (nop) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | case never executed: 0x0000:case 0x0000:never executed: nc = wc; break;case 0x0000:never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | case never executed: 0x0002:case 0x0002:never executed: nc = ((1 && case 0x0002: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | ((*
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | (unsigned char)wc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | ))] & (unsigned short int) _ISlower)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | ) ? | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | (__extension__ ({ int __res; if (sizeof (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | wc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | ) > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | wc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | )
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | wc | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | ); __res = __c < -128
never executed: else __res = toupper (end of blocknever executed: __res = toupper ( wc ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | wc never executed: __res = toupper ( wc ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | ); never executed: } else __res = (*__ctype_toupper_loc ())[(int) (__res = toupper ( wc );never executed: __res = (*__ctype_toupper_loc ())[(int) ( wc )]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | wc never executed: __res = (*__ctype_toupper_loc ())[(int) ( wc )]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | )]; never executed: __res; })) __res = (*__ctype_toupper_loc ())[(int) ( wc )]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | : (wc)); break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | case never executed: 0x0001:case 0x0001:never executed: nc = ((1 && case 0x0001: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | ((*
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | (unsigned char)wc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | ))] & (unsigned short int) _ISupper)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | ) ? | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | (__extension__ ({ int __res; if (sizeof (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | wc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | ) > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | wc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | )
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | wc | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | ); __res = __c < -128
never executed: else __res = tolower (end of blocknever executed: __res = tolower ( wc ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | wc never executed: __res = tolower ( wc ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | ); never executed: } else __res = (*__ctype_tolower_loc ())[(int) (__res = tolower ( wc );never executed: __res = (*__ctype_tolower_loc ())[(int) ( wc )]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | wc never executed: __res = (*__ctype_tolower_loc ())[(int) ( wc )]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | )]; never executed: __res; })) __res = (*__ctype_tolower_loc ())[(int) ( wc )]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | : (wc)); break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | case never executed: 0x0020:case 0x0020:never executed: case 0x0020: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | case never executed: 0x0010:case 0x0010:never executed: nc = (iswupper (wc)case 0x0010:
never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | ret[retind++] = nc; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | m = mbrtowc (&wc, string + start, end - start, &state); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | if (((
| 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | wc = (unsigned char)string[start]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | goto never executed: singlebyte;goto singlebyte;never executed: goto singlebyte; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | else if (((
| 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | wc = L'\0'; never executed: wc = L'\0'; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | switch (nop) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | case executed 458 times by 1 test: 0x0000:case 0x0000:Executed by:
executed 458 times by 1 test: nwc = wc; break;case 0x0000:Executed by:
executed 458 times by 1 test: break;Executed by:
| 458 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | case executed 427 times by 1 test: 0x0002:case 0x0002:Executed by:
executed 427 times by 1 test: nwc = (iswlower (wc)case 0x0002:Executed by:
executed 427 times by 1 test: break;Executed by:
| 50-427 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | case executed 514 times by 1 test: 0x0001:case 0x0001:Executed by:
executed 514 times by 1 test: nwc = (iswupper (wc)case 0x0001:Executed by:
executed 514 times by 1 test: break;Executed by:
| 164-514 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | case executed 9 times by 1 test: 0x0020:case 0x0020:Executed by:
executed 9 times by 1 test: case 0x0020:Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | case executed 1 time by 1 test: 0x0010:case 0x0010:Executed by:
executed 1 time by 1 test: nwc = (iswupper (wc)case 0x0010:Executed by:
executed 10 times by 1 test: break;Executed by:
| 0-10 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | if ((
| 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | (0x7f * 2 + 1)
| 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | && is_basic ((int)nwc)
| 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | ret[retind++] = nwc; executed 1409 times by 1 test: ret[retind++] = nwc;Executed by:
| 1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | mlen = wcrtomb (mb, nwc, &state); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | if (mlen > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | mb[mlen] = '\0'; never executed: mb[mlen] = '\0'; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | __builtin_strncpy ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | ret + retind | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | mb | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | mlen | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | retind += mlen; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | do { if (locale_mb_cur_max > 1
executed 1409 times by 1 test: else if (locale_utf8localemblength = 1;Executed by:
never executed: else { state_bak = state; mblength = mbrlen ((string) + (start), (end) - (start), &state); }mblength = 1;never executed: if (mblength == (size_t)-2end of block
never executed: else if (mblength == 0end of block
never executed: start)++;(start)++;never executed: else ((start)++;executed 1409 times by 1 test: start) += mblength;(start) += mblength;Executed by:
executed 1409 times by 1 test: } else ((start) += mblength;Executed by:
never executed: start)++;(start)++;never executed: } while (0);(start)++; | 0-1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } executed 1409 times by 1 test: end of blockExecuted by:
| 1409 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | ret[retind] = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | return executed 128 times by 1 test: ret;return ret;Executed by:
executed 128 times by 1 test: return ret;Executed by:
| 128 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |