Make minor improvements

- Work towards simplifying ape.S startup process
- Rewrote ar because it took minutes to build cosmopolitan.a
This commit is contained in:
Justine Tunney 2020-11-09 15:41:11 -08:00
parent 95bc650be8
commit aea89fe832
70 changed files with 1037 additions and 456 deletions

View file

@ -20,9 +20,20 @@
#include "libc/nexgen32e/hascharacter.h"
#include "libc/str/str.h"
#undef strcspn
#define char wchar_t
#define HasCharacter HasCharacterWide
#define strcspn wcscspn
#include "libc/str/strcspn.c"
/**
* Returns prefix length, consisting of chars not in reject.
* a.k.a. Return index of first byte that's in charset.
*
* @param reject is nul-terminated character set
* @see strspn(), strtok_r()
* @asyncsignalsafe
*/
size_t wcscspn(const wchar_t *s, const wchar_t *reject) {
size_t i;
for (i = 0; s[i]; ++i) {
if (HasCharacterWide(s[i], reject)) {
break;
}
}
return i;
}