mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04: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 *
|
static inline struct option *
|
||||||
get_mime_handler_option(unsigned char *type, int xwin)
|
get_mime_handler_option(unsigned char *type, int xwin)
|
||||||
{
|
{
|
||||||
|
struct option *handler_opt;
|
||||||
struct option *type_opt = get_mime_type_option(type);
|
struct option *type_opt = get_mime_type_option(type);
|
||||||
unsigned char *name;
|
|
||||||
|
|
||||||
if (!type_opt) return NULL;
|
if (!type_opt) return NULL;
|
||||||
|
|
||||||
name = straconcat("mime.handler.", type_opt->value.string,
|
handler_opt = get_opt_rec_real(config_options, "mime.handler");
|
||||||
".", get_system_str(xwin), NULL);
|
if (!handler_opt) return NULL;
|
||||||
if (!name) return NULL;
|
|
||||||
|
|
||||||
type_opt = get_opt_rec_real(config_options, name);
|
handler_opt = get_opt_rec_real(handler_opt, type_opt->value.string);
|
||||||
mem_free(name);
|
if (!handler_opt) return NULL;
|
||||||
|
|
||||||
return type_opt;
|
return get_opt_rec_real(handler_opt, get_system_str(xwin));
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mime_handler *
|
static struct mime_handler *
|
||||||
|
Loading…
Reference in New Issue
Block a user