[exim-cvs] Supply strchrnul() for platforms apparently missi…

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Exim Git Commits Mailing List
Fecha:  
A: exim-cvs
Asunto: [exim-cvs] Supply strchrnul() for platforms apparently missing it
Gitweb: https://git.exim.org/exim.git/commitdiff/5930166b443390a522f210c2e60ec447a7dbd080
Commit:     5930166b443390a522f210c2e60ec447a7dbd080
Parent:     2658a023286fcce529031e9f071c5579650687b8
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Wed Dec 6 12:25:14 2023 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Wed Dec 6 12:26:38 2023 +0000


    Supply strchrnul() for platforms apparently missing it


    Broken-by: 2658a023286f
---
 src/OS/os.h-FreeBSD |  2 ++
 src/OS/os.h-Linux   |  2 ++
 src/src/os.c        | 15 +++++++++++++++
 3 files changed, 19 insertions(+)


diff --git a/src/OS/os.h-FreeBSD b/src/OS/os.h-FreeBSD
index 6756d42f6..11f8b1ae7 100644
--- a/src/OS/os.h-FreeBSD
+++ b/src/OS/os.h-FreeBSD
@@ -78,5 +78,7 @@ extern ssize_t os_sendfile(int, int, off_t *, size_t);
/*******************/

#define EXIM_HAVE_KEVENT
+#define EXIM_HAVE_STRCHRNUL
+

/* End */
diff --git a/src/OS/os.h-Linux b/src/OS/os.h-Linux
index 25a12862b..cebda3367 100644
--- a/src/OS/os.h-Linux
+++ b/src/OS/os.h-Linux
@@ -102,4 +102,6 @@ then change the 0 to 1 in the next block. */
# define NS_MAXMSG 65535
#endif

+#define EXIM_HAVE_STRCHRNUL
+
/* End */
diff --git a/src/src/os.c b/src/src/os.c
index 5c52c6d4d..5e5899eeb 100644
--- a/src/src/os.c
+++ b/src/src/os.c
@@ -893,6 +893,21 @@ return buffer ? buffer : realloc(b, strlen(b) + 1);
#endif

 /* ----------------------------------------------------------------------- */
+/***********************************************************
+*             strchrnul()                                  *
+***********************************************************/
+
+#if !defined(EXIM_HAVE_STRCHRNUL)
+char *
+strchrnul(const char * s, int c)
+{
+while (*s != c && *s) s++
+return CS s;
+}
+#endif
+
+
+/* ----------------------------------------------------------------------- */





--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/