]> git.sesse.net Git - vlc/blobdiff - src/config/cmdline.c
commandline parsing: Fix the macfreetv crash
[vlc] / src / config / cmdline.c
index ad5f2ca4e8d1a0da1390f18746a162dc8e043a63..8de2e2224d8ff15e87b9acdc2150862caad27e45 100644 (file)
@@ -274,6 +274,14 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
                     psz_name = p_conf->psz_name;
                 }
 
+               if( p_conf->i_type != CONFIG_ITEM_BOOL && !optarg )
+               {
+                   fprintf( stderr, "Warning: missing argument for option --%s\n", p_conf->psz_name );
+                   fprintf( stderr, "Try specifying options as '--optionname=value' instead of '--optionname value'\n" );
+                   continue;
+               }
+
+
                 switch( p_conf->i_type )
                 {
                     case CONFIG_ITEM_STRING: