Fixed AddTranslator to behave like Be's version: Translators passed to the function are added even if they are already in the list.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6006 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber
2004-01-10 19:47:28 +00:00
parent e0712711bc
commit b6aabb5c95
+2 -15
View File
@@ -489,22 +489,9 @@ BTranslatorRoster::AddTranslator(BTranslator *translator)
status_t result = B_NOT_INITIALIZED; status_t result = B_NOT_INITIALIZED;
if (fSem > 0 && acquire_sem(fSem) == B_NO_ERROR) { if (fSem > 0 && acquire_sem(fSem) == B_NO_ERROR) {
// Determine if translator is already in the list // Add the translator to the list even if
translator_node *pNode = fpTranslators; // it is already in the list
while (pNode) {
// If translator is in the list, don't add it
if (!strcmp(pNode->translator->TranslatorName(),
translator->TranslatorName())) {
result = B_OK;
break;
}
pNode = pNode->next;
}
// if translator is NOT in the list, add it
if (!pNode)
result = AddTranslatorToList(translator); result = AddTranslatorToList(translator);
release_sem(fSem); release_sem(fSem);
} }