mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
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:
parent
95bc650be8
commit
aea89fe832
70 changed files with 1037 additions and 456 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue