mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Add fake support for locale="" (#546)
This commit is contained in:
parent
6c3048821c
commit
27416e7dd6
2 changed files with 34 additions and 2 deletions
|
@ -17,16 +17,18 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/locale.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Sets program locale.
|
||||
*
|
||||
* Cosmopolitan only supports the C or POSIX locale.
|
||||
*
|
||||
* "You can have any locale you want as long as it's C." -- Henry Ford
|
||||
*/
|
||||
char *setlocale(int category, const char *locale) {
|
||||
if (!locale) return "C";
|
||||
if (!locale || (*locale == '\0')) return "C";
|
||||
if (!strcmp(locale, "C") || !strcmp(locale, "POSIX")) {
|
||||
return locale;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue