[haiku-commits] haiku: hrev44894 - src/kits/locale

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 24 Nov 2012 22:06:18 +0100 (CET)

hrev44894 adds 1 changeset to branch 'master'
old head: f1ea2af3e73d3bf9c49d0904c5fd9143170a64fd
new head: f139447d0a19999bec733843f7c7a388ef454f84
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=f139447+%5Ef1ea2af

----------------------------------------------------------------------------

f139447: Fix catalogs stored in resources
  We used the hash of the language code as a key for identifying catalogs.
  However, hash do collide, and in particular, "en" and "fi" have the same hash.
  Identify catalog resources by name instead.

                [ Adrien Destugues - PulkoMandy <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44894
Commit:      f139447d0a19999bec733843f7c7a388ef454f84
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f139447
Author:      Adrien Destugues - PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Nov 24 20:56:45 2012 UTC

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 4 deletions(-)
src/kits/locale/DefaultCatalog.cpp | 6 ++----

----------------------------------------------------------------------------

diff --git a/src/kits/locale/DefaultCatalog.cpp 
b/src/kits/locale/DefaultCatalog.cpp
index b56368f..09d5978 100644
--- a/src/kits/locale/DefaultCatalog.cpp
+++ b/src/kits/locale/DefaultCatalog.cpp
@@ -273,10 +273,8 @@ DefaultCatalog::ReadFromResource(const entry_ref 
&appOrAddOnRef)
        if (res != B_OK)
                return res;
 
-       int mangledLanguage = CatKey::HashFun(fLanguageName.String(), 0);
-
        size_t sz;
-       const void *buf = rsrc.LoadResource('CADA', mangledLanguage, &sz);
+       const void *buf = rsrc.LoadResource('CADA', fLanguageName, &sz);
        if (!buf)
                return B_NAME_NOT_FOUND;
 
@@ -370,7 +368,7 @@ DefaultCatalog::WriteToResource(const entry_ref 
&appOrAddOnRef)
        if (res == B_OK) {
                res = rsrc.AddResource('CADA', mangledLanguage,
                        mallocIO.Buffer(), mallocIO.BufferLength(),
-                       BString(fLanguageName) << " catalog");
+                       BString(fLanguageName));
        }
 
        return res;


Other related posts:

  • » [haiku-commits] haiku: hrev44894 - src/kits/locale - pulkomandy