mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
MIME: get_mime_handler_option: More option API usage, less string
manipulation.
This commit is contained in:
parent
8f4b40d4a0
commit
06a541487e
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user