summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2021-09-22 08:52:27 +0000
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-10-03 05:28:51 +0000
commit1b078f87b77e65afac3a998af8223bbebe729df0 (patch)
treece0c6d5d77e8a4ef5885736f6a430f3ea7ca995b /Userland
parentc80b65b8276dd3f2edc21ec0e3e304b45522e24b (diff)
downloadserenity-1b078f87b77e65afac3a998af8223bbebe729df0.zip
LibC: Implement wcspbrk
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibC/wchar.cpp11
-rw-r--r--Userland/Libraries/LibC/wchar.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/wchar.cpp b/Userland/Libraries/LibC/wchar.cpp
index ab7de3e653..39eb3e8579 100644
--- a/Userland/Libraries/LibC/wchar.cpp
+++ b/Userland/Libraries/LibC/wchar.cpp
@@ -344,4 +344,15 @@ int mbsinit(const mbstate_t* state)
return 1;
}
+
+wchar_t* wcspbrk(const wchar_t* wcs, const wchar_t* accept)
+{
+ for (const wchar_t* cur = accept; *cur; cur++) {
+ wchar_t* res = wcschr(wcs, *cur);
+ if (res)
+ return res;
+ }
+
+ return nullptr;
+}
}
diff --git a/Userland/Libraries/LibC/wchar.h b/Userland/Libraries/LibC/wchar.h
index 2db7dc4da6..98c6824945 100644
--- a/Userland/Libraries/LibC/wchar.h
+++ b/Userland/Libraries/LibC/wchar.h
@@ -41,5 +41,6 @@ size_t wcrtomb(char*, wchar_t, mbstate_t*);
int wcscoll(const wchar_t*, const wchar_t*);
int wctob(wint_t);
int mbsinit(const mbstate_t*);
+wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
__END_DECLS