Skip to content

Commit

Permalink
Quick hack for rline to not have locales break float parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Feb 25, 2024
1 parent f1d7bda commit 0c8cb94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vendor/rline.c
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,8 @@ static int read_line(void) {
int rline(char * buffer, int buf_size) {
#ifndef _WIN32
setlocale(LC_ALL, "");
/* If the requested locale doesn't use . as a radix point, fall back to C to not break float parsing. */
if (strtod("0.5",NULL) != 0.5) setlocale(LC_ALL, "C.UTF-8");
#else
setlocale(LC_ALL, "C.UTF-8");
#endif
Expand Down

0 comments on commit 0c8cb94

Please sign in to comment.