mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
parent
c3ed8d6c7f
commit
d769df3482
17 changed files with 102 additions and 155 deletions
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
|
||||
/**
|
||||
|
@ -25,5 +26,10 @@
|
|||
* Cosmopolitan only supports the C or POSIX locale.
|
||||
*/
|
||||
char *setlocale(int category, const char *locale) {
|
||||
return firstnonnull(locale, "C");
|
||||
if (!locale) return "C";
|
||||
if (!strcmp(locale, "C") || !strcmp(locale, "POSIX")) {
|
||||
return locale;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue