summaryrefslogtreecommitdiff
path: root/src/peerinfo-tool/gnunet-peerinfo_plugins.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-12 13:04:38 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-12 13:04:38 +0000
commit6272777c0cdf48f86b96e2b7c4749e821ccba286 (patch)
treee965c5bf722fbd264540b01325ba2b53025281f2 /src/peerinfo-tool/gnunet-peerinfo_plugins.c
parentf7b950749a0b2cf525cd812576ecde4227f813a2 (diff)
substring search is the root of all evil:
peerinfo did load wrong plugin if substring matches: used https for http address
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo_plugins.c')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo_plugins.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo_plugins.c b/src/peerinfo-tool/gnunet-peerinfo_plugins.c
index 3bca9feb2..29dc4d017 100644
--- a/src/peerinfo-tool/gnunet-peerinfo_plugins.c
+++ b/src/peerinfo-tool/gnunet-peerinfo_plugins.c
@@ -168,14 +168,23 @@ GPI_plugins_find (const char *name)
struct TransportPlugin *head = plugins_head;
char *stripped = GNUNET_strdup (name);
+ char *head_stripped;
char *sep = strchr (stripped, '_');
if (NULL != sep)
sep[0] = '\0';
while (head != NULL)
{
- if (head->short_name == strstr (head->short_name, stripped))
- break;
+ head_stripped = GNUNET_strdup(head->short_name);
+ char *head_sep = strchr (head_stripped, '_');
+ if (NULL != head_sep)
+ head_sep[0] = '\0';
+ if (0 == strcmp (head_stripped, stripped))
+ {
+ GNUNET_free (head_stripped);
+ break;
+ }
+ GNUNET_free (head_stripped);
head = head->next;
}
GNUNET_free (stripped);