]> git.pld-linux.org Git - packages/poldek.git/commitdiff
- do not check for utf-8 version. This is a rewrite of the langs_forward.patch
authorwitekfl <witekfl@pld-linux.org>
Wed, 10 Dec 2008 15:05:14 +0000 (15:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- langs must enumerated from the end to the beginning.

Changed files:
    poldek-noutf8.patch -> 1.1

poldek-noutf8.patch [new file with mode: 0644]

diff --git a/poldek-noutf8.patch b/poldek-noutf8.patch
new file mode 100644 (file)
index 0000000..fd2d1e3
--- /dev/null
@@ -0,0 +1,44 @@
+--- poldek-0.30-cvs20080820.23/pkgdir/pndir/description.c.old  2008-12-10 15:50:49.000000000 +0100
++++ poldek-0.30-cvs20080820.23/pkgdir/pndir/description.c      2008-12-10 15:52:39.000000000 +0100
+@@ -165,9 +165,8 @@ struct pkguinf *pndir_load_pkguinf(tn_al
+         /* start from the end => the last loaded one will be set as
+            pkguinf default (see pkguinf_restore_i18n()) */
+         for (i = n_array_size(langs) - 1; i >= 0; i--) {
+-            const char *lang, *loaded_lang = NULL;
++            const char *lang;
+             struct tndb *db;
+-            char lang_utf8[32];
+             char dkey[512];
+             int  dklen;
+@@ -178,26 +177,17 @@ struct pkguinf *pndir_load_pkguinf(tn_al
+             if ((db = pndir_db_dscr_h_get(db_dscr_h, lang)) == NULL)
+                 continue;
+-            n_snprintf(lang_utf8, sizeof(lang_utf8), "%s.UTF-8", lang);
+-            loaded_lang = lang_utf8;
+-
+-            dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang_utf8);
++            dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang);
+             vlen = tndb_get(db, dkey, dklen, val, sizeof(val));
+-            
+-            if (vlen == 0) {     /* not exists */
+-                dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang);
+-                vlen = tndb_get(db, dkey, dklen, val, sizeof(val));
+-                loaded_lang = lang;
+-            }
+-                
+-            DBGF("ld %s: %s (%d)\n", pkg_id(pkg), loaded_lang ? loaded_lang : lang, vlen);
++
++            DBGF("ld %s: %s (%d)\n", pkg_id(pkg), lang, vlen);
+             
+             if (vlen > 0) {
+                 tn_buf_it it;
+                 n_buf_clean(nbuf);
+                 n_buf_init(nbuf, val, vlen);
+                 n_buf_it_init(&it, nbuf);
+-                pkguinf_restore_i18n(pkgu, &it, loaded_lang);
++                pkguinf_restore_i18n(pkgu, &it, lang);
+             }
+         }
+     }
This page took 0.036312 seconds and 4 git commands to generate.