table printer: Use localeconv for decimal point

This gives us a chance of working correctly in exotic locales.
This commit is contained in:
Matthias Clasen
2017-05-02 10:23:57 -04:00
committed by Alexander Larsson
parent 5635adea29
commit ea93b3977d

View File

@@ -26,6 +26,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <locale.h>
typedef struct {
@@ -93,8 +94,10 @@ flatpak_table_printer_add_aligned_column (FlatpakTablePrinter *printer,
static const char *
find_decimal_point (const char *text)
{
// FIXME use localeconv
return strchr (text, '.');
struct lconv *locale_data;
locale_data = localeconv ();
return strstr (text, locale_data->decimal_point);
}
void