aboutsummaryrefslogtreecommitdiffstats
path: root/jnlib
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2006-10-19 14:22:06 +0000
committerWerner Koch <[email protected]>2006-10-19 14:22:06 +0000
commitdf52700f5c694a9cd5fa2f10b2c3633aee9343a9 (patch)
tree70a78d2e1def01b7b550767f819d74a22eb4db23 /jnlib
parentPreparing a release (diff)
downloadgnupg-df52700f5c694a9cd5fa2f10b2c3633aee9343a9.tar.gz
gnupg-df52700f5c694a9cd5fa2f10b2c3633aee9343a9.zip
Fixes
Diffstat (limited to 'jnlib')
-rw-r--r--jnlib/ChangeLog4
-rw-r--r--jnlib/stringhelp.c12
-rw-r--r--jnlib/stringhelp.h4
3 files changed, 20 insertions, 0 deletions
diff --git a/jnlib/ChangeLog b/jnlib/ChangeLog
index 7273f0e5f..65e7d4786 100644
--- a/jnlib/ChangeLog
+++ b/jnlib/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-19 Werner Koch <[email protected]>
+
+ * stringhelp.c (memrchr) [!HAVE_MEMRCHR]: Provide a replacement.
+
2006-09-27 Werner Koch <[email protected]>
* mischelp.c: New.
diff --git a/jnlib/stringhelp.c b/jnlib/stringhelp.c
index 4e2768251..1731dd946 100644
--- a/jnlib/stringhelp.c
+++ b/jnlib/stringhelp.c
@@ -796,3 +796,15 @@ memicmp( const char *a, const char *b, size_t n )
#endif
+#ifndef HAVE_MEMRCHR
+void *
+memrchr (const void *buffer, int c, size_t n)
+{
+ const unsigned char *p = buffer;
+
+ for (p += n; n ; n--)
+ if (*--p == c)
+ return p;
+ return NULL;
+}
+#endif /*HAVE_MEMRCHR*/
diff --git a/jnlib/stringhelp.h b/jnlib/stringhelp.h
index 5de50befe..adbd9bf02 100644
--- a/jnlib/stringhelp.h
+++ b/jnlib/stringhelp.h
@@ -95,6 +95,10 @@ char *strlwr(char *a);
#ifndef HAVE_STRICMP
# define stricmp(a,b) strcasecmp( (a), (b) )
#endif
+#ifndef HAVE_MEMRCHR
+void *memrchr (const void *buffer, int c, size_t n);
+#endif
+
#ifndef HAVE_ISASCII
static inline int