Merge branch '3883_size_trunc_sep'

* 3883_size_trunc_sep:
  Ticket #3883: size_trunc_sep() breaks on multibyte locales.
This commit is contained in:
Andrew Borodin 2017-12-02 20:07:08 +03:00
commit 37dcdf65b3

View File

@ -383,7 +383,9 @@ size_trunc_sep (uintmax_t size, gboolean use_si)
p += strlen (p) - 1;
d = x + sizeof (x) - 1;
*d-- = '\0';
while (p >= y && (isalpha ((unsigned char) *p) || (unsigned char) *p == ' '))
/* @size format is "size unit", i.e. "[digits][space][letters]".
Copy all charactes after digits. */
while (p >= y && !g_ascii_isdigit (*p))
*d-- = *p--;
for (count = 0; p >= y; count++)
{