From 32da50fafb0a9da3794c758a70d7a730ca4c05d1 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Mar 2008 17:47:52 +0000 Subject: [PATCH] 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 --- src/system/libroot/posix/locale/setlocale.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system/libroot/posix/locale/setlocale.c b/src/system/libroot/posix/locale/setlocale.c index 0bf9b26ce5..1979cb6e03 100644 --- a/src/system/libroot/posix/locale/setlocale.c +++ b/src/system/libroot/posix/locale/setlocale.c @@ -6,14 +6,16 @@ #include #include +#include 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; }