Debug: expansions: refactor ascii-art/UTF8; mark up space & nl
[exim.git] / src / src / os.c
index 87a33693576904d9e7b523667600975108a3bbb7..3b49e4b9e980755b418e45e534f79229b1d9fcbc 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) The Exim Maintainers 2021 - 2022 */
+/* Copyright (c) The Exim Maintainers 2021 - 2023 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 /* SPDX-License-Identifier: GPL-2.0-or-later */
@@ -12,7 +12,8 @@
 # include <stdio.h>
 # include <time.h>
 #else
-# define DEBUG(x) if (debug_selector & (x))
+# define IS_DEBUG(x) (debug_selector & (x))
+# define DEBUG(x) if (IS_DEBUG(x))
 #endif
 
 #ifndef CS
@@ -893,6 +894,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
+
+
+/* ----------------------------------------------------------------------- */