diff options
Diffstat (limited to 'lib/rbcodec/metadata/metadata_common.c')
-rw-r--r-- | lib/rbcodec/metadata/metadata_common.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/lib/rbcodec/metadata/metadata_common.c b/lib/rbcodec/metadata/metadata_common.c index 202da49522..59c2f01840 100644 --- a/lib/rbcodec/metadata/metadata_common.c +++ b/lib/rbcodec/metadata/metadata_common.c | |||
@@ -260,32 +260,16 @@ bool skip_id3v2(int fd, struct mp3entry *id3) | |||
260 | */ | 260 | */ |
261 | int string_option(const char *option, const char *const oplist[], bool ignore_case) | 261 | int string_option(const char *option, const char *const oplist[], bool ignore_case) |
262 | { | 262 | { |
263 | int i; | ||
264 | int ifound = -1; | ||
265 | const char *op; | 263 | const char *op; |
266 | if (ignore_case) | 264 | int (*cmp_fn)(const char*, const char*) = &strcasecmp; |
265 | if (!ignore_case) | ||
266 | cmp_fn = strcmp; | ||
267 | for (int i=0; (op=oplist[i]) != NULL; i++) | ||
267 | { | 268 | { |
268 | for (i=0; (op=oplist[i]) != NULL; i++) | 269 | if (cmp_fn(op, option) == 0) |
269 | { | 270 | return i; |
270 | if (strcasecmp(op, option) == 0) | ||
271 | { | ||
272 | ifound = i; | ||
273 | break; | ||
274 | } | ||
275 | } | ||
276 | } | ||
277 | else | ||
278 | { | ||
279 | for (i=0; (op=oplist[i]) != NULL; i++) | ||
280 | { | ||
281 | if (strcmp(op, option) == 0) | ||
282 | { | ||
283 | ifound = i; | ||
284 | break; | ||
285 | } | ||
286 | } | ||
287 | } | 271 | } |
288 | return ifound; | 272 | return -1; |
289 | } | 273 | } |
290 | #endif | 274 | #endif |
291 | /* Parse the tag (the name-value pair) and fill id3 and buffer accordingly. | 275 | /* Parse the tag (the name-value pair) and fill id3 and buffer accordingly. |