diff options
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo_plugins.c')
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo_plugins.c | 13 |
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) | |||
168 | struct TransportPlugin *head = plugins_head; | 168 | struct TransportPlugin *head = plugins_head; |
169 | 169 | ||
170 | char *stripped = GNUNET_strdup (name); | 170 | char *stripped = GNUNET_strdup (name); |
171 | char *head_stripped; | ||
171 | char *sep = strchr (stripped, '_'); | 172 | char *sep = strchr (stripped, '_'); |
172 | if (NULL != sep) | 173 | if (NULL != sep) |
173 | sep[0] = '\0'; | 174 | sep[0] = '\0'; |
174 | 175 | ||
175 | while (head != NULL) | 176 | while (head != NULL) |
176 | { | 177 | { |
177 | if (head->short_name == strstr (head->short_name, stripped)) | 178 | head_stripped = GNUNET_strdup(head->short_name); |
178 | break; | 179 | char *head_sep = strchr (head_stripped, '_'); |
180 | if (NULL != head_sep) | ||
181 | head_sep[0] = '\0'; | ||
182 | if (0 == strcmp (head_stripped, stripped)) | ||
183 | { | ||
184 | GNUNET_free (head_stripped); | ||
185 | break; | ||
186 | } | ||
187 | GNUNET_free (head_stripped); | ||
179 | head = head->next; | 188 | head = head->next; |
180 | } | 189 | } |
181 | GNUNET_free (stripped); | 190 | GNUNET_free (stripped); |