6332N/Amemrchr compatibility stub taken from sudo.
6332N/A21158555 - solaris should provide memrchr for bsd / linux compatibility
6332N/A
6332N/A--- gcr-3.16.0/configure.ac 2015-05-12 07:27:59.000000000 -0700
6332N/A+++ gcr-3.16.0/configure.ac 2015-05-27 16:50:16.536249851 -0700
6332N/A@@ -144,6 +144,7 @@
6332N/A #
6332N/A
6332N/A AC_CHECK_FUNCS(timegm, AC_DEFINE(HAVE_TIMEGM,1,[Have timegm]))
6332N/A+AC_CHECK_FUNCS(memrchr, AC_DEFINE(HAVE_MEMRCHR,1,[Have memrchr]))
6332N/A AC_CHECK_FUNCS(mlock)
6332N/A
6332N/A # --------------------------------------------------------------------
6332N/A--- gcr-3.16.0/egg/egg-armor.c 2015-04-06 11:28:46.000000000 -0700
6332N/A+++ gcr-3.16.0/egg/egg-armor.c 2015-05-27 16:59:15.748737526 -0700
6332N/A@@ -31,7 +31,7 @@
6332N/A #include <glib.h>
6332N/A
6332N/A #include <ctype.h>
6332N/A-#include <string.h>
6332N/A+#include "egg-memrchr.h"
6332N/A
6332N/A /*
6332N/A * Armor looks like:
6332N/A--- gcr-3.16.0/egg/egg-memrchr.c 1969-12-31 16:00:00.000000000 -0800
6332N/A+++ gcr-3.16.0/egg/egg-memrchr.c 2015-05-27 16:56:33.358969153 -0700
6332N/A@@ -0,0 +1,42 @@
6332N/A+/*
6332N/A+ * Copyright (c) 2007, 2010-2011, 2013
6332N/A+ * Todd C. Miller <Todd.Miller@courtesan.com>
6332N/A+ *
6332N/A+ * Permission to use, copy, modify, and distribute this software for any
6332N/A+ * purpose with or without fee is hereby granted, provided that the above
6332N/A+ * copyright notice and this permission notice appear in all copies.
6332N/A+ *
6332N/A+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
6332N/A+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
6332N/A+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
6332N/A+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
6332N/A+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
6332N/A+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
6332N/A+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6332N/A+ */
6332N/A+
6332N/A+#include <config.h>
6332N/A+
6332N/A+#ifndef HAVE_MEMRCHR
6332N/A+
6332N/A+#include <sys/types.h>
6332N/A+
6332N/A+/*
6332N/A+ * Reverse memchr()
6332N/A+ * Find the last occurrence of 'c' in the buffer 's' of size 'n'.
6332N/A+ */
6332N/A+void *
6332N/A+memrchr(const void *s, int c, size_t n)
6332N/A+{
6332N/A+ const unsigned char *cp;
6332N/A+
6332N/A+ if (n != 0) {
6332N/A+ cp = (unsigned char *)s + n;
6332N/A+ do {
6332N/A+ if (*(--cp) == (unsigned char)c)
6332N/A+ return (void *)cp;
6332N/A+ } while (--n != 0);
6332N/A+ }
6332N/A+ return (void *)0;
6332N/A+}
6332N/A+#endif /* HAVE_MEMRCHR */
6332N/A--- gcr-3.16.0/egg/egg-memrchr.h 1969-12-31 16:00:00.000000000 -0800
6332N/A+++ gcr-3.16.0/egg/egg-memrchr.h 2015-05-27 16:57:08.717867655 -0700
6332N/A@@ -0,0 +1,30 @@
6332N/A+/*
6332N/A+ * Copyright (c) 2007, 2010-2011, 2013
6332N/A+ * Todd C. Miller <Todd.Miller@courtesan.com>
6332N/A+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
6332N/A+ *
6332N/A+ * Permission to use, copy, modify, and distribute this software for any
6332N/A+ * purpose with or without fee is hereby granted, provided that the above
6332N/A+ * copyright notice and this permission notice appear in all copies.
6332N/A+ *
6332N/A+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
6332N/A+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
6332N/A+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
6332N/A+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
6332N/A+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
6332N/A+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
6332N/A+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6332N/A+ */
6332N/A+
6332N/A+#ifndef EGG_MEMRCHR_H_
6332N/A+#define EGG_MEMRCHR_H_
6332N/A+
6332N/A+#include <string.h>
6332N/A+
6332N/A+#ifndef HAVE_MEMRCHR
6332N/A+
6332N/A+void * memrchr (const void *s, int c, size_t n);
6332N/A+
6332N/A+#endif
6332N/A+
6332N/A+#endif /* EGG_MEMRCHR_H_ */
6332N/A--- gcr-3.16.0/egg/Makefile.am 2015-04-06 11:28:46.000000000 -0700
6332N/A+++ gcr-3.16.0/egg/Makefile.am 2015-05-27 16:58:43.053533180 -0700
6332N/A@@ -27,6 +27,7 @@
6332N/A egg/egg-hex.c egg/egg-hex.h \
6332N/A egg/egg-hkdf.c egg/egg-hkdf.h \
6332N/A egg/egg-libgcrypt.c egg/egg-libgcrypt.h \
6332N/A+ egg/egg-memrchr.c egg/egg-memrchr.h \
6332N/A egg/egg-oid.c egg/egg-oid.h \
6332N/A egg/egg-padding.c egg/egg-padding.h \
6332N/A egg/egg-openssl.c egg/egg-openssl.h \