summaryrefslogtreecommitdiffstats
path: root/common/miscellaneous.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-05-23 18:19:43 +0200
committerWerner Koch <wk@gnupg.org>2006-05-23 18:19:43 +0200
commitfbe4ac37f6d3e7870e26caffb0d21c3c77198297 (patch)
treef21028be87bda6df4f2f1e3ae105feeb5a2eb158 /common/miscellaneous.c
parent2006-05-19 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-fbe4ac37f6d3e7870e26caffb0d21c3c77198297.tar.xz
gnupg2-fbe4ac37f6d3e7870e26caffb0d21c3c77198297.zip
g10/ does build again.
Diffstat (limited to 'common/miscellaneous.c')
-rw-r--r--common/miscellaneous.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/common/miscellaneous.c b/common/miscellaneous.c
index 14d6f020d..e9f8ed27f 100644
--- a/common/miscellaneous.c
+++ b/common/miscellaneous.c
@@ -1,5 +1,5 @@
/* miscellaneous.c - Stuff not fitting elsewhere
- * Copyright (C) 2003 Free Software Foundation, Inc.
+ * Copyright (C) 2003, 2006 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -47,6 +47,7 @@ print_fname_stdin (const char *s)
return s;
}
+/* fixme: Globally replace it by print_sanitized_buffer. */
void
print_string( FILE *fp, const byte *p, size_t n, int delim )
{
@@ -125,4 +126,25 @@ leave:
}
+/* Try match against each substring of multistr, delimited by | */
+int
+match_multistr (const char *multistr,const char *match)
+{
+ do
+ {
+ size_t seglen = strcspn (multistr,"|");
+ if (!seglen)
+ break;
+ /* Using the localized strncasecmp! */
+ if (strncasecmp(multistr,match,seglen)==0)
+ return 1;
+ multistr += seglen;
+ if (*multistr == '|')
+ multistr++;
+ }
+ while (*multistr);
+
+ return 0;
+}
+