2010-02-15 18:15:21 +01:00
|
|
|
--- builtins/printf.def
|
|
|
|
+++ builtins/printf.def 2006-07-27 15:11:19.000000000 +0000
|
2009-08-28 17:45:57 +02:00
|
|
|
@@ -47,6 +47,7 @@ error occurs.
|
2006-12-15 18:03:59 +01:00
|
|
|
$END
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
+#include <locale.h>
|
|
|
|
|
|
|
|
#include "../bashtypes.h"
|
|
|
|
|
2009-08-28 17:45:57 +02:00
|
|
|
@@ -529,12 +530,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;
|
|
|
|
}
|
|
|
|
|