« third_party/modest/source/modest/finder/finder.c
↑ Summary
third_party/modest/source/modest/finder/pseudo_class.c »
| 1 | /* | ||||||||||||||||||||||||||||||
| 2 | Copyright (C) 2016-2017 Alexander Borisov | ||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||
| 4 | This library is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||||
| 5 | modify it under the terms of the GNU Lesser General Public | ||||||||||||||||||||||||||||||
| 6 | License as published by the Free Software Foundation; either | ||||||||||||||||||||||||||||||
| 7 | version 2.1 of the License, or (at your option) any later version. | ||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||
| 9 | This library is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||||||||||||||||||||||||||||
| 12 | Lesser General Public License for more details. | ||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||
| 14 | You should have received a copy of the GNU Lesser General Public | ||||||||||||||||||||||||||||||
| 15 | License along with this library; if not, write to the Free Software | ||||||||||||||||||||||||||||||
| 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||
| 18 | Author: lex.borisov@gmail.com (Alexander Borisov) | ||||||||||||||||||||||||||||||
| 19 | */ | ||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||
| 21 | #include "modest/finder/match.h" | ||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||
| 23 | 0 | bool modest_finder_match_attribute_only_key(myhtml_token_attr_t* attr, const char* key, size_t key_len) | |||||||||||||||||||||||||||||
| 24 | { | ||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if(key == NULL) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 26 | 0 | return false; | |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 29 | { | ||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 32 | 0 | return true; | |||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||
| 35 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||
| 38 | 0 | return false; | |||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||
| 41 | 0 | bool modest_finder_match_attribute_eq(myhtml_token_attr_t* attr, const char* key, size_t key_len, const char* value, size_t value_len, bool case_sensitive) | |||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | if(key == NULL || value == NULL) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 44 | 0 | return false; | |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 47 | { | ||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 50 | { | ||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if(attr->value.length == value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | if(case_sensitive) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if(strncmp(value, attr->value.data, value_len) == 0) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 54 | 0 | return true; | |||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||
| 57 | else { | ||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if(mycore_strncasecmp(value, attr->value.data, value_len) == 0) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 59 | 0 | return true; | |||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||
| 64 | 0 | break; | |||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||
| 68 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||
| 71 | 0 | return false; | |||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||
| 74 | 0 | bool modest_finder_match_attribute_ws(myhtml_token_attr_t* attr, const char* key, size_t key_len, const char* value, size_t value_len, bool case_sensitive) | |||||||||||||||||||||||||||||
| 75 | { | ||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | if(key == NULL || value == NULL) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 77 | 0 | return false; | |||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 80 | { | ||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 83 | { | ||||||||||||||||||||||||||||||
| 84 | 0 | size_t i = 0; | |||||||||||||||||||||||||||||
| 85 | size_t begin; | ||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | if(attr->value.length >= value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | if(case_sensitive) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 89 | { | ||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | while(i < attr->value.length) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 91 | { | ||||||||||||||||||||||||||||||
| 92 | 0 | begin = i; | |||||||||||||||||||||||||||||
| 93 | 0 | ▶ | while(i < attr->value.length && mycore_utils_whithspace(attr->value.data[i], !=, &&)) {i++;} | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | if((i - begin) == value_len && (mycore_strncmp(value, &attr->value.data[begin], value_len) == 0)) { | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 96 | 0 | return true; | |||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||
| 98 | /* skip all ws */ | ||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | while(i < attr->value.length && mycore_utils_whithspace(attr->value.data[i], ==, ||)) {i++;} | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||
| 102 | else { | ||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | while(i < attr->value.length) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 104 | { | ||||||||||||||||||||||||||||||
| 105 | 0 | begin = i; | |||||||||||||||||||||||||||||
| 106 | 0 | ▶ | while(i < attr->value.length && mycore_utils_whithspace(attr->value.data[i], !=, &&)) {i++;} | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | if((i - begin) == value_len && (mycore_strncasecmp(value, &attr->value.data[begin], value_len) == 0)) { | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 109 | 0 | return true; | |||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||
| 111 | /* skip all ws */ | ||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | while(i < attr->value.length && mycore_utils_whithspace(attr->value.data[i], ==, ||)) {i++;} | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||
| 117 | 0 | break; | |||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||
| 121 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||
| 124 | 0 | return false; | |||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||
| 127 | 0 | bool modest_finder_match_attribute_begin(myhtml_token_attr_t* attr, const char* key, size_t key_len, const char* value, size_t value_len, bool case_sensitive) | |||||||||||||||||||||||||||||
| 128 | { | ||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | if(key == NULL || value == NULL) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 130 | 0 | return false; | |||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 133 | { | ||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | if(attr->value.length >= value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | if(case_sensitive) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | if(mycore_strncmp(value, attr->value.data, value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 140 | 0 | return true; | |||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||
| 142 | else { | ||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | if(mycore_strncasecmp(value, attr->value.data, value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 144 | 0 | return true; | |||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||
| 148 | 0 | break; | |||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||
| 152 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||
| 155 | 0 | return false; | |||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||
| 158 | 0 | bool modest_finder_match_attribute_end(myhtml_token_attr_t* attr, const char* key, size_t key_len, const char* value, size_t value_len, bool case_sensitive) | |||||||||||||||||||||||||||||
| 159 | { | ||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | if(key == NULL || value == NULL) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 161 | 0 | return false; | |||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 164 | { | ||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 167 | { | ||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | if(attr->value.length >= value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if(case_sensitive) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | if(mycore_strncmp(value, &attr->value.data[ (attr->value.length - value_len) ], value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 171 | 0 | return true; | |||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||
| 173 | else { | ||||||||||||||||||||||||||||||
| 174 | 0 | ▶ | if(mycore_strncasecmp(value, &attr->value.data[ (attr->value.length - value_len) ], value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 175 | 0 | return true; | |||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||
| 179 | 0 | break; | |||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||
| 183 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||
| 186 | 0 | return false; | |||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||
| 189 | 0 | bool modest_finder_match_attribute_sub(myhtml_token_attr_t* attr, const char* key, size_t key_len, const char* value, size_t value_len, bool case_sensitive) | |||||||||||||||||||||||||||||
| 190 | { | ||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | if(key == NULL || value == NULL) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 192 | 0 | return false; | |||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 195 | { | ||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 198 | { | ||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | if(attr->value.length >= value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 200 | 0 | size_t i = 0; | |||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | if(case_sensitive) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 203 | { | ||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | while ((i + value_len) <= attr->value.length) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 205 | { | ||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | if(mycore_strncmp(value, &attr->value.data[i], value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 207 | 0 | return true; | |||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||
| 209 | 0 | i++; | |||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||
| 212 | else { | ||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | while ((i + value_len) <= attr->value.length) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 214 | { | ||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | if(mycore_strncasecmp(value, &attr->value.data[i], value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 216 | 0 | return true; | |||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||
| 218 | 0 | i++; | |||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||
| 223 | 0 | break; | |||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||
| 227 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||
| 230 | 0 | return false; | |||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||
| 233 | 0 | bool modest_finder_match_attribute_hsp(myhtml_token_attr_t* attr, const char* key, size_t key_len, const char* value, size_t value_len, bool case_sensitive) | |||||||||||||||||||||||||||||
| 234 | { | ||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | if(key == NULL || value == NULL) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 236 | 0 | return false; | |||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | while (attr) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 239 | { | ||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | if(attr->key.length == key_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | if(mycore_strncasecmp(key, attr->key.data, key_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 242 | { | ||||||||||||||||||||||||||||||
| 243 | 0 | ▶ | if(attr->value.length == value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | if(case_sensitive) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | if(mycore_strncmp(value, attr->value.data, value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 246 | 0 | return true; | |||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||
| 248 | else { | ||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | if(mycore_strncasecmp(value, attr->value.data, value_len) == 0) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 250 | 0 | return true; | |||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | else if(attr->value.length > value_len) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | if(case_sensitive) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 255 | 0 | ▶ | if(mycore_strncmp(value, attr->value.data, value_len) == 0) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | if(attr->value.data[value_len] == '-') | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 257 | 0 | return true; | |||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||
| 260 | else { | ||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | if(mycore_strncasecmp(value, attr->value.data, value_len) == 0) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | if(attr->value.data[value_len] == '-') | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 263 | 0 | return true; | |||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||
| 268 | 0 | break; | |||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||
| 272 | 0 | attr = attr->next; | |||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||
| 275 | 0 | return false; | |||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||