summaryrefslogtreecommitdiff
path: root/src/peerinfo-tool/gnunet-peerinfo_plugins.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-09-21 12:15:18 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-09-21 12:15:18 +0000
commit23fbfdade60daf4b88cec374ccd4532d8c87324b (patch)
tree53619a522bf2453e5f44e1d62ba497c3d35d71e1 /src/peerinfo-tool/gnunet-peerinfo_plugins.c
parent0f50ba19f099a7ed3c98f92028ea6f96dfd1aa73 (diff)
prefix based plugin lookup for peerinfo tool
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo_plugins.c')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo_plugins.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo_plugins.c b/src/peerinfo-tool/gnunet-peerinfo_plugins.c
index ba7c1d392..3bca9feb2 100644
--- a/src/peerinfo-tool/gnunet-peerinfo_plugins.c
+++ b/src/peerinfo-tool/gnunet-peerinfo_plugins.c
@@ -167,8 +167,18 @@ GPI_plugins_find (const char *name)
{
struct TransportPlugin *head = plugins_head;
- while ((head != NULL) && (0 != strcmp (name, head->short_name)))
+ char *stripped = GNUNET_strdup (name);
+ char *sep = strchr (stripped, '_');
+ if (NULL != sep)
+ sep[0] = '\0';
+
+ while (head != NULL)
+ {
+ if (head->short_name == strstr (head->short_name, stripped))
+ break;
head = head->next;
+ }
+ GNUNET_free (stripped);
if (NULL == head)
return NULL;
return head->api;