1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-01 02:05:33 +00:00

MIME: get_mime_handler_option: More option API usage, less string

manipulation.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-05-05 21:21:42 +00:00 committed by Miciah Dashiel Butler Masters
parent 8f4b40d4a0
commit 06a541487e

View File

@ -174,19 +174,18 @@ get_mime_type_option(unsigned char *type)
static inline struct option *
get_mime_handler_option(unsigned char *type, int xwin)
{
struct option *handler_opt;
struct option *type_opt = get_mime_type_option(type);
unsigned char *name;
if (!type_opt) return NULL;
name = straconcat("mime.handler.", type_opt->value.string,
".", get_system_str(xwin), NULL);
if (!name) return NULL;
handler_opt = get_opt_rec_real(config_options, "mime.handler");
if (!handler_opt) return NULL;
type_opt = get_opt_rec_real(config_options, name);
mem_free(name);
handler_opt = get_opt_rec_real(handler_opt, type_opt->value.string);
if (!handler_opt) return NULL;
return type_opt;
return get_opt_rec_real(handler_opt, get_system_str(xwin));
}
static struct mime_handler *