summaryrefslogtreecommitdiffstats
path: root/common/recsel.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:05 +0000
commite7fd617327ed9d30f093a78a016511ab5c984ba4 (patch)
treebb534b4fd912969c90022ad00726253be891ad8a /common/recsel.c
parentReleasing progress-linux version 2.2.40-3~progress7.99u1. (diff)
downloadgnupg2-e7fd617327ed9d30f093a78a016511ab5c984ba4.tar.xz
gnupg2-e7fd617327ed9d30f093a78a016511ab5c984ba4.zip
Merging upstream version 2.2.43.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'common/recsel.c')
-rw-r--r--common/recsel.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/common/recsel.c b/common/recsel.c
index df77b57..3fb401f 100644
--- a/common/recsel.c
+++ b/common/recsel.c
@@ -85,37 +85,6 @@ my_error (gpg_err_code_t ec)
}
-/* This is a case-sensitive version of our memistr. I wonder why no
- * standard function memstr exists but I better do not use the name
- * memstr to avoid future conflicts.
- *
- * FIXME: Move this to a stringhelp.c
- */
-static const char *
-my_memstr (const void *buffer, size_t buflen, const char *sub)
-{
- const unsigned char *buf = buffer;
- const unsigned char *t = (const unsigned char *)buf;
- const unsigned char *s = (const unsigned char *)sub;
- size_t n = buflen;
-
- for ( ; n ; t++, n-- )
- {
- if (*t == *s)
- {
- for (buf = t++, buflen = n--, s++; n && *t ==*s; t++, s++, n--)
- ;
- if (!*s)
- return (const char*)buf;
- t = (const unsigned char *)buf;
- s = (const unsigned char *)sub ;
- n = buflen;
- }
- }
- return NULL;
-}
-
-
/* Return a pointer to the next logical connection operator or NULL if
* none. */
static char *
@@ -553,7 +522,7 @@ recsel_select (recsel_expr_t selector,
break;
case SELECT_SUB:
if (se->xcase)
- result = !!my_memstr (value, valuelen, se->value);
+ result = !!gnupg_memstr (value, valuelen, se->value);
else
result = !!memistr (value, valuelen, se->value);
break;