mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-04 02:40:49 +02:00
commit bash-20140327 snapshot
This commit is contained in:
+14
-1
@@ -1083,6 +1083,19 @@ extern int timeval_to_cpu __P((struct timeval *, struct timeval *, struct timeva
|
||||
|
||||
static const int precs[] = { 0, 100, 10, 1 };
|
||||
|
||||
#if defined (HAVE_LOCALE_H) && defined (HAVE_LOCALECONV)
|
||||
static int
|
||||
decpoint ()
|
||||
{
|
||||
struct lconv *lv;
|
||||
|
||||
lv = localeconv ();
|
||||
return (lv && lv->decimal_point && lv->decimal_point[0]) ? lv->decimal_point[0] : '.';
|
||||
}
|
||||
#else
|
||||
# define decpoint() '.'
|
||||
#endif
|
||||
|
||||
/* Expand one `%'-prefixed escape sequence from a time format string. */
|
||||
static int
|
||||
mkfmt (buf, prec, lng, sec, sec_fraction)
|
||||
@@ -1127,7 +1140,7 @@ mkfmt (buf, prec, lng, sec, sec_fraction)
|
||||
and 999. */
|
||||
if (prec != 0)
|
||||
{
|
||||
buf[ind++] = '.';
|
||||
buf[ind++] = decpoint ();
|
||||
for (aind = 1; aind <= prec; aind++)
|
||||
{
|
||||
buf[ind++] = (sec_fraction / precs[aind]) + '0';
|
||||
|
||||
Reference in New Issue
Block a user