diff m_config.c @ 26408:7a36d5941fd8

Replace the trivial command line preparser with a more robust version allowing all kind of options to be used.
author albeu
date Sun, 13 Apr 2008 19:18:51 +0000
parents 6e53dfe38594
children 0f1b5b68af32
line wrap: on
line diff
--- a/m_config.c	Sun Apr 13 11:15:08 2008 +0000
+++ b/m_config.c	Sun Apr 13 19:18:51 2008 +0000
@@ -308,6 +308,13 @@
     mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidCmdlineOption,arg);
     return M_OPT_INVALID;
   }
+  // During command line preparse set only pre-parse options
+  // Otherwise only set pre-parse option if they were not already set.
+  if(((config->mode == M_COMMAND_LINE_PRE_PARSE) &&
+      !(co->opt->flags & M_OPT_PRE_PARSE)) ||
+     ((config->mode != M_COMMAND_LINE_PRE_PARSE) &&
+      (co->opt->flags & M_OPT_PRE_PARSE) && (co->flags & M_CFG_OPT_SET)))
+    set = 0;
 
   // Option with children are a bit different to parse
   if(co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) {