2016-09-16 13:10:58 +02:00
|
|
|
---
|
|
|
|
builtins/printf.def | 11 ++++++++++-
|
|
|
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
|
|
|
|
2010-02-18 12:17:29 +01:00
|
|
|
--- builtins/printf.def
|
2019-01-09 14:08:47 +01:00
|
|
|
+++ builtins/printf.def 2018-11-29 08:11:53.901189708 +0000
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -54,6 +54,7 @@ error occurs.
|
2006-12-15 18:03:59 +01:00
|
|
|
$END
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
+#include <locale.h>
|
|
|
|
|
|
|
|
#include "../bashtypes.h"
|
|
|
|
|
2019-01-09 14:08:47 +01:00
|
|
|
@@ -662,12 +663,20 @@ printf_builtin (list)
|
2006-12-15 18:03:59 +01:00
|
|
|
case 'A':
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
- char *f;
|
|
|
|
+ char *f, *lce = getenv("LC_NUMERIC"), *lcl = setlocale(LC_NUMERIC, NULL);
|
|
|
|
floatmax_t p;
|
|
|
|
|
|
|
|
p = getfloatmax ();
|
|
|
|
f = mklong (start, FLOATMAX_CONV, sizeof(FLOATMAX_CONV) - 1);
|
|
|
|
+
|
|
|
|
+ if (lce && lcl)
|
|
|
|
+ setlocale(LC_NUMERIC, lce);
|
|
|
|
+
|
|
|
|
PF (f, p);
|
|
|
|
+
|
|
|
|
+ if (lce && lcl)
|
|
|
|
+ setlocale(LC_NUMERIC, lcl);
|
|
|
|
+
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|