poldek: poldek/pkgu.c - bugfix (megabajt)

mis mis at pld-linux.org
Mon Jun 2 22:51:58 CEST 2008


Author: mis                          Date: Mon Jun  2 20:51:58 2008 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- bugfix (megabajt)

---- Files affected:
poldek/poldek:
   pkgu.c (1.41 -> 1.42) 

---- Diffs:

================================================================
Index: poldek/poldek/pkgu.c
diff -u poldek/poldek/pkgu.c:1.41 poldek/poldek/pkgu.c:1.42
--- poldek/poldek/pkgu.c:1.41	Sat May 31 15:01:40 2008
+++ poldek/poldek/pkgu.c	Mon Jun  2 22:51:53 2008
@@ -676,6 +676,14 @@
             inf = pkguinf_i18n_new(pkgu->_na, summs[i], descrs[i]);
             n_hash_insert(pkgu->_ht, lang, inf);
         }
+
+        /* langs which weren't added to the pkgu->_ht have to be removed,
+           otherwise lc_lang_select() may return value which doesn't exist
+           in the hash table */
+        if (n < n_array_size (langs)) {
+    	    for (i = n_array_size(langs); i > n; i--)
+                langs = n_array_remove_nth(langs, i - 1);
+        }
         
         sl_langs = lc_lang_select(langs, lc_messages_lang());
         if (sl_langs == NULL)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/pkgu.c?r1=1.41&r2=1.42&f=u



More information about the pld-cvs-commit mailing list