wok diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/hardinfo/stuff/languages.patch	Mon Feb 23 13:44:27 2009 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +--- arch/common/languages.h	2008-04-26 10:04:42.000000000 +0200
     1.5 ++++ arch/common/languages.h	2008-04-26 10:51:31.000000000 +0200
     1.6 +@@ -21,6 +21,7 @@
     1.7 + {
     1.8 +     FILE *locale;
     1.9 +     gchar buf[512], *retval = NULL;
    1.10 ++    int last = 0;
    1.11 + 
    1.12 +     locale = popen("locale -va", "r");
    1.13 +     if (!locale)
    1.14 +@@ -37,7 +38,8 @@
    1.15 + 	  *date = NULL,
    1.16 + 	  *codeset = NULL;
    1.17 + 
    1.18 +-    while (fgets(buf, 512, locale)) {
    1.19 ++    while (fgets(buf, 512, locale) || last++ == 0) {
    1.20 ++	if (last) buf[0] = 0;
    1.21 + 	if (!strncmp(buf, "locale:", 7)) {
    1.22 + 	    sscanf(buf, "locale: %s", name);
    1.23 + 	    fgets(buf, 128, locale);