Skip to content

Commit

Permalink
Move setlocale() closer to config file read/write.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb committed Oct 11, 2023
1 parent 06da9fb commit 58cad13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <locale.h>
#ifdef HAVE_NETWORKING
#include <net/net_compat.h>
#include <net/net_socket.h>
Expand Down Expand Up @@ -1166,6 +1167,7 @@ bool command_event_save_config(
const char *str = path_exists ? config_path :
path_get(RARCH_PATH_CONFIG);

setlocale(LC_NUMERIC,"C");
if (path_exists && config_save_file(config_path))
{
snprintf(s, len, "%s \"%s\".",
Expand Down
2 changes: 1 addition & 1 deletion retroarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -4857,7 +4857,6 @@ int rarch_main(int argc, char *argv[], void *data)
command_event(CMD_EVENT_HISTORY_DEINIT, NULL);
retroarch_favorites_deinit();

setlocale(LC_NUMERIC,"C");
retroarch_config_init();

retroarch_deinit_drivers(&runloop_st->retro_ctx);
Expand Down Expand Up @@ -5872,6 +5871,7 @@ static bool retroarch_parse_input_and_config(
if (!(p_rarch->flags & RARCH_FLAGS_BLOCK_CONFIG_READ))
#endif
{
setlocale(LC_NUMERIC,"C");
/* If this is a static build, load salamander
* config file first (sets RARCH_PATH_CORE) */
#if !defined(HAVE_DYNAMIC)
Expand Down

0 comments on commit 58cad13

Please sign in to comment.