wok view hardinfo/stuff/languages.patch @ rev 22836

dukto: normalize $VERSION
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 10 15:18:14 2020 +0100 (2020-02-10)
parents c5069bc9ff25
children
line source
1 --- arch/common/languages.h 2008-04-26 10:04:42.000000000 +0200
2 +++ arch/common/languages.h 2008-04-26 10:51:31.000000000 +0200
3 @@ -21,6 +21,7 @@
4 {
5 FILE *locale;
6 gchar buf[512], *retval = NULL;
7 + int last = 0;
9 locale = popen("locale -va", "r");
10 if (!locale)
11 @@ -37,7 +38,8 @@
12 *date = NULL,
13 *codeset = NULL;
15 - while (fgets(buf, 512, locale)) {
16 + while (fgets(buf, 512, locale) || last++ == 0) {
17 + if (last) buf[0] = 0;
18 if (!strncmp(buf, "locale:", 7)) {
19 sscanf(buf, "locale: %s", name);
20 (void)fgets(buf, 128, locale);