From 975efec61b83b840cf18ab2ee23b9202c60ca8a7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 23 Nov 2022 11:24:26 +0100 Subject: tool_operate: override the numeric locale and set "C" by force Makes curl always use dot as decimal separator for options, independently of what the locale says. Makes scripts and command lines portable. Updated docs accordingly. Reported-by: Daniel Faust Fixes #9969 Closes #9972 --- src/tool_operate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tool_operate.c b/src/tool_operate.c index cd137ec10..7af73a266 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2638,9 +2638,10 @@ CURLcode operate(struct GlobalConfig *global, int argc, argv_item_t argv[]) CURLcode result = CURLE_OK; char *first_arg = argc > 1 ? curlx_convert_tchar_to_UTF8(argv[1]) : NULL; - /* Setup proper locale from environment */ #ifdef HAVE_SETLOCALE + /* Override locale for number parsing (only) */ setlocale(LC_ALL, ""); + setlocale(LC_NUMERIC, "C"); #endif /* Parse .curlrc if necessary */ -- cgit v1.2.1