X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fconfig%2Fcmdline.c;h=5f2a6ab8f783561c5c33c448508873f91440b124;hb=a57a4a64dead1bf8a477a7fa04bf021573703f1f;hp=8de2e2224d8ff15e87b9acdc2150862caad27e45;hpb=687c86594fa47ce21b2c838b05c5b078fb51a288;p=vlc diff --git a/src/config/cmdline.c b/src/config/cmdline.c index 8de2e2224d..5f2a6ab8f7 100644 --- a/src/config/cmdline.c +++ b/src/config/cmdline.c @@ -27,7 +27,8 @@ #include #include "../libvlc.h" -#include "vlc_keys.h" +#include +#include #ifdef HAVE_GETOPT_LONG # ifdef HAVE_GETOPT_H @@ -58,31 +59,12 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0; module_t *p_parser; struct option *p_longopts; - int i_modules_index; const char **argv_copy = NULL; /* Short options */ module_config_t *pp_shortopts[256]; char *psz_shortopts; -#ifdef __APPLE__ - /* When VLC.app is run by double clicking in Mac OS X, the 2nd arg - * is the PSN - process serial number (a unique PID-ish thingie) - * still ok for real Darwin & when run from command line */ - if ( (*pi_argc > 1) && (strncmp( ppsz_argv[ 1 ] , "-psn" , 4 ) == 0) ) - /* for example -psn_0_9306113 */ - { - /* GDMF!... I can't do this or else the MacOSX window server will - * not pick up the PSN and not register the app and we crash... - * hence the following kludge otherwise we'll get confused w/ argv[1] - * being an input file name. - * As there won't be any more args to parse, just exit. */ - assert( *pi_argc == 2 ); - *pi_argc = 1; - return 0; - } -#endif - /* List all modules */ module_t **list = module_list_get (NULL); @@ -273,15 +255,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; - } - - +#ifdef __APPLE__ + 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; + } +#endif switch( p_conf->i_type ) { case CONFIG_ITEM_STRING: @@ -298,7 +279,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, config_PutInt( p_this, psz_name, strtol(optarg, 0, 0)); break; case CONFIG_ITEM_FLOAT: - config_PutFloat( p_this, psz_name, (float)atof(optarg) ); + config_PutFloat( p_this, psz_name, us_atof(optarg) ); break; case CONFIG_ITEM_KEY: config_PutInt( p_this, psz_name, ConfigStringToKey( optarg ) );