Skip to content

Commit

Permalink
Merge pull request LinuxCNC#3040 from rmu75/rs/fix-locale-restore-2.9
Browse files Browse the repository at this point in the history
fix restoring of locale setting in interp
  • Loading branch information
andypugh authored Jul 24, 2024
2 parents d82caa4 + 3a60651 commit 3cfcf62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/emc/rs274ngc/interp_internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -995,9 +995,9 @@ macros totally crash-proof. If the function call stack is deeper than

struct scoped_locale {
scoped_locale(int category_, const char *locale_) : category(category_), oldlocale(setlocale(category, NULL)) { setlocale(category, locale_); }
~scoped_locale() { setlocale(category, oldlocale); }
~scoped_locale() { setlocale(category, oldlocale.c_str()); }
int category;
const char *oldlocale;
std::string oldlocale;
};

#define FORCE_LC_NUMERIC_C scoped_locale force_lc_numeric_c(LC_NUMERIC, "C")
Expand Down

0 comments on commit 3cfcf62

Please sign in to comment.