wok-stable view hardinfo/stuff/languages.patch @ rev 12465

Up e2fsprogs (1.44.2)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 04 18:42:23 2019 +0100 (2019-03-04)
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);