Allow setting the local to "C" (i.e. not changing it at all). This makes

programs happy, that do that unconditionally (e.g. some Perl test).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24334 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-03-09 17:47:52 +00:00
parent 6e4432bc6f
commit 32da50fafb

View File

@ -6,14 +6,16 @@
#include <locale.h>
#include <limits.h>
#include <string.h>
char *
setlocale(int category, const char *locale)
{
if (locale == NULL || !locale[0])
if (locale == NULL || !locale[0] || strcmp(locale, "C") == 0)
return "C";
// ToDo: this should check if liblocale.so is available and use its functions
// TODO: this should check if liblocale.so is available and use its
// functions.
return NULL;
}