From 30478150363e7644bda967c71f941218d3a3b58e Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 19 Jul 2010 15:47:06 +0000 Subject: [PATCH] * Fix \x parsing in collectcatkeys again (thanks to Kaliber) * Hide the CatalogStub::GetCatalog method so that if liblocalestub.a is missing from a localized image, it will not try to steal the catalog of another one. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37602 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/locale/Catalog.h | 3 ++- src/kits/locale/CatalogStub.cpp | 7 ++++++- src/kits/locale/HashMapCatalog.cpp | 2 +- src/tools/locale/HashMapCatalog.cpp | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/headers/os/locale/Catalog.h b/headers/os/locale/Catalog.h index 30db9861c8..a68e471e85 100644 --- a/headers/os/locale/Catalog.h +++ b/headers/os/locale/Catalog.h @@ -57,7 +57,8 @@ class BCatalog { // This must be included (statically linked) into each shared object needing // a catalog on its own (application, add-on, library, ...). The shared object // must also have a mimetype so that the catalog can be identified. -class BCatalogStub { +class BCatalogStub +{ private: static BCatalog sCatalog; static vint32 sCatalogInitOnce; diff --git a/src/kits/locale/CatalogStub.cpp b/src/kits/locale/CatalogStub.cpp index fea914c0d2..d7be4dfcc7 100644 --- a/src/kits/locale/CatalogStub.cpp +++ b/src/kits/locale/CatalogStub.cpp @@ -19,10 +19,15 @@ vint32 BCatalogStub::sCatalogInitOnce = false; /* static */ BCatalog* BCatalogStub::GetCatalog() { + #if (__GNUC__ < 3) + asm volatile(".hidden GetCatalog__12BCatalogStub"); + #else + asm volatile(".hidden _ZN12BCatalogStub10GetCatalogEv"); + #endif + return be_locale_roster->GetCatalog(&sCatalog, &sCatalogInitOnce); } - /* static */ void BCatalogStub::ForceReload() { diff --git a/src/kits/locale/HashMapCatalog.cpp b/src/kits/locale/HashMapCatalog.cpp index 71ab423837..6eff488d45 100644 --- a/src/kits/locale/HashMapCatalog.cpp +++ b/src/kits/locale/HashMapCatalog.cpp @@ -164,7 +164,7 @@ parseQuotedChars(BString& stringToParse) char tmp[3]; tmp[0] = *(in+1); tmp[1] = *(in+2); - tmp[3] = '\0'; + tmp[2] = '\0'; unsigned int hexchar = strtoul(tmp, NULL, 16); *out = hexchar; // skip the number diff --git a/src/tools/locale/HashMapCatalog.cpp b/src/tools/locale/HashMapCatalog.cpp index 7ef31c327b..b59b40f0fb 100644 --- a/src/tools/locale/HashMapCatalog.cpp +++ b/src/tools/locale/HashMapCatalog.cpp @@ -168,7 +168,7 @@ parseQuotedChars(BString& stringToParse) char tmp[3]; tmp[0] = *(in+1); tmp[1] = *(in+2); - tmp[3] = '\0'; + tmp[2] = '\0'; unsigned int hexchar = strtoul(tmp, NULL, 16); *out = hexchar; // skip the number