LibC: Implement setlocale() for C locale
This commit is contained in:
15
userspace/libraries/LibC/locale.cpp
Normal file
15
userspace/libraries/LibC/locale.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
|
||||
// FIXME: Actually support locales
|
||||
char* setlocale(int category, const char* locale)
|
||||
{
|
||||
(void)category;
|
||||
|
||||
static char s_locale[] = "C";
|
||||
if (locale == nullptr)
|
||||
return s_locale;
|
||||
if (strcmp(locale, "") == 0 || strcmp(locale, "C") == 0 || strcmp(locale, "POSIX") == 0)
|
||||
return s_locale;
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user