@@ -4709,6 +4709,7 @@ static bool config_load_file(global_t *global,
47094709 */
47104710bool config_load_override (void * data )
47114711{
4712+ const char * a = NULL ;
47124713 char core_path [PATH_MAX_LENGTH ];
47134714 char game_path [PATH_MAX_LENGTH ];
47144715 char content_path [PATH_MAX_LENGTH ];
@@ -4774,15 +4775,13 @@ bool config_load_override(void *data)
47744775 /* Create a new config file from core_path */
47754776 if (path_is_valid (core_path ))
47764777 {
4778+ const char * a = path_get (RARCH_PATH_CONFIG_OVERRIDE );
47774779 RARCH_LOG ("[Override] Core-specific overrides found at \"%s\".\n" ,
47784780 core_path );
4779-
4780- if (should_append && !string_is_empty (path_get (RARCH_PATH_CONFIG_OVERRIDE )))
4781+ if (should_append && a && * a )
47814782 {
47824783 char tmp_path [PATH_MAX_LENGTH ];
4783- size_t _len = strlcpy (tmp_path ,
4784- path_get (RARCH_PATH_CONFIG_OVERRIDE ),
4785- sizeof (tmp_path ) - 2 );
4784+ size_t _len = strlcpy (tmp_path , a , sizeof (tmp_path ) - 2 );
47864785 tmp_path [ _len ] = '|' ;
47874786 tmp_path [++ _len ] = '\0' ;
47884787 strlcpy (tmp_path + _len , core_path , sizeof (tmp_path ) - _len );
@@ -4801,15 +4800,14 @@ bool config_load_override(void *data)
48014800 /* Create a new config file from content_path */
48024801 if (path_is_valid (content_path ))
48034802 {
4803+ const char * a = path_get (RARCH_PATH_CONFIG_OVERRIDE );
48044804 RARCH_LOG ("[Override] Content dir-specific overrides found at \"%s\".\n" ,
48054805 content_path );
48064806
4807- if (should_append && ! string_is_empty ( path_get ( RARCH_PATH_CONFIG_OVERRIDE )) )
4807+ if (should_append && a && * a )
48084808 {
48094809 char tmp_path [PATH_MAX_LENGTH ];
4810- size_t _len = strlcpy (tmp_path ,
4811- path_get (RARCH_PATH_CONFIG_OVERRIDE ),
4812- sizeof (tmp_path ) - 2 );
4810+ size_t _len = strlcpy (tmp_path , a , sizeof (tmp_path ) - 2 );
48134811 tmp_path [ _len ] = '|' ;
48144812 tmp_path [++ _len ] = '\0' ;
48154813 strlcpy (tmp_path + _len , content_path , sizeof (tmp_path ) - _len );
@@ -4826,15 +4824,14 @@ bool config_load_override(void *data)
48264824 /* Create a new config file from game_path */
48274825 if (path_is_valid (game_path ))
48284826 {
4827+ const char * a = path_get (RARCH_PATH_CONFIG_OVERRIDE );
48294828 RARCH_LOG ("[Override] Game-specific overrides found at \"%s\".\n" ,
48304829 game_path );
48314830
4832- if (should_append && ! string_is_empty ( path_get ( RARCH_PATH_CONFIG_OVERRIDE )) )
4831+ if (should_append && a && * a )
48334832 {
48344833 char tmp_path [PATH_MAX_LENGTH ];
4835- size_t _len = strlcpy (tmp_path ,
4836- path_get (RARCH_PATH_CONFIG_OVERRIDE ),
4837- sizeof (tmp_path ) - 2 );
4834+ size_t _len = strlcpy (tmp_path , a , sizeof (tmp_path ) - 2 );
48384835 tmp_path [ _len ] = '|' ;
48394836 tmp_path [++ _len ] = '\0' ;
48404837 strlcpy (tmp_path + _len , game_path , sizeof (tmp_path ) - _len );
@@ -4861,8 +4858,9 @@ bool config_load_override(void *data)
48614858 if (!config_load_file (global_get_ptr (), path_get (RARCH_PATH_CONFIG ), settings ))
48624859 return false;
48634860
4861+ a = path_get (RARCH_PATH_CONFIG_OVERRIDE );
48644862 if ( settings -> bools .notification_show_config_override_load
4865- && ! string_is_empty ( path_get ( RARCH_PATH_CONFIG_OVERRIDE )) )
4863+ && a && * a )
48664864 {
48674865 char msg [128 ];
48684866 size_t _len = strlcpy (msg , msg_hash_to_str (MSG_CONFIG_OVERRIDE_LOADED ), sizeof (msg ));
@@ -4874,7 +4872,8 @@ bool config_load_override(void *data)
48744872 retroarch_override_setting_set (RARCH_OVERRIDE_SETTING_STATE_PATH , NULL );
48754873 retroarch_override_setting_set (RARCH_OVERRIDE_SETTING_SAVE_PATH , NULL );
48764874
4877- if (!string_is_empty (path_get (RARCH_PATH_CONFIG_OVERRIDE )))
4875+ a = path_get (RARCH_PATH_CONFIG_OVERRIDE );
4876+ if (a && * a )
48784877 runloop_state_get_ptr ()-> flags |= RUNLOOP_FLAG_OVERRIDES_ACTIVE ;
48794878 else
48804879 runloop_state_get_ptr ()-> flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE ;
@@ -4884,7 +4883,8 @@ bool config_load_override(void *data)
48844883
48854884bool config_load_override_file (const char * config_path )
48864885{
4887- settings_t * settings = config_st ;
4886+ const char * a = NULL ;
4887+ settings_t * settings = config_st ;
48884888
48894889 path_clear (RARCH_PATH_CONFIG_OVERRIDE );
48904890
@@ -4915,7 +4915,8 @@ bool config_load_override_file(const char *config_path)
49154915 retroarch_override_setting_set (RARCH_OVERRIDE_SETTING_STATE_PATH , NULL );
49164916 retroarch_override_setting_set (RARCH_OVERRIDE_SETTING_SAVE_PATH , NULL );
49174917
4918- if (!string_is_empty (path_get (RARCH_PATH_CONFIG_OVERRIDE )))
4918+ a = path_get (RARCH_PATH_CONFIG_OVERRIDE );
4919+ if (a && * a )
49194920 runloop_state_get_ptr ()-> flags |= RUNLOOP_FLAG_OVERRIDES_ACTIVE ;
49204921 else
49214922 runloop_state_get_ptr ()-> flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE ;
@@ -5607,6 +5608,7 @@ bool config_save_autoconf_profile(const char *device_name, unsigned user)
56075608 unsigned i ;
56085609 char buf [PATH_MAX_LENGTH ];
56095610 char autoconf_file [PATH_MAX_LENGTH ];
5611+ const char * a = NULL ;
56105612 config_file_t * conf = NULL ;
56115613 int32_t pid_user = 0 ;
56125614 int32_t vid_user = 0 ;
@@ -5702,9 +5704,11 @@ bool config_save_autoconf_profile(const char *device_name, unsigned user)
57025704 joypad_driver );
57035705 config_set_string (conf , "input_device" ,
57045706 input_config_get_device_name (settings -> uints .input_joypad_index [user ]));
5707+ a =
5708+ input_config_get_device_display_name (settings -> uints .input_joypad_index [user ]);
57055709 config_set_string (conf , "input_device_display_name" ,
5706- ! string_is_empty ( input_config_get_device_display_name ( settings -> uints . input_joypad_index [ user ]) )
5707- ? input_config_get_device_display_name ( settings -> uints . input_joypad_index [ user ])
5710+ ( a && * a )
5711+ ? a
57085712 : input_config_get_device_name (settings -> uints .input_joypad_index [user ]));
57095713
57105714 pid_user = input_config_get_device_pid (settings -> uints .input_joypad_index [user ]);
0 commit comments