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

Up: bash (4.0)
author Christophe Lincoln <pankso@slitaz.org>
date Mon Feb 23 13:44:27 2009 +0100 (2009-02-23)
parents
children 4de2c7803ae7
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 fgets(buf, 128, locale);