commit bash-20140327 snapshot

This commit is contained in:
Chet Ramey
2014-04-07 10:47:09 -04:00
parent e2f12fdf57
commit c28fcb7eb4
31 changed files with 30785 additions and 1096 deletions
+14 -1
View File
@@ -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';