From 826c19f706ffbbf901d493fa603d2586712e4f18 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 Nov 2012 00:42:27 +0100 Subject: parser-mpcmd: minor simplification Note that we don't care that mpv prints "fatal error" as exit reason when help was requested and printed (e.g. "mpv -h"). --- parser-mpcmd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/parser-mpcmd.c b/parser-mpcmd.c index d87e820e0f..730e4c581f 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -156,7 +156,6 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, int argc, char **argv) { int mode = 0; - bool opt_exit = false; // exit immediately after parsing (help options) struct playlist_entry *local_start = NULL; bool shuffle = false; @@ -182,10 +181,9 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, } else { r = m_config_check_option(config, p.arg, p.param); } - if (r <= M_OPT_EXIT) { - opt_exit = true; - r = M_OPT_EXIT - r; - } else if (r < 0) { + if (r <= M_OPT_EXIT) + goto err_out; + if (r < 0) { char *msg = m_option_strerror(r); if (!msg) goto print_err; @@ -316,9 +314,6 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, goto err_out; } - if (opt_exit) - goto err_out; - if (shuffle) playlist_shuffle(files); -- cgit v1.2.3