diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-21 12:15:18 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-21 12:15:18 +0000 |
commit | 23fbfdade60daf4b88cec374ccd4532d8c87324b (patch) | |
tree | 53619a522bf2453e5f44e1d62ba497c3d35d71e1 | |
parent | 0f50ba19f099a7ed3c98f92028ea6f96dfd1aa73 (diff) | |
download | gnunet-23fbfdade60daf4b88cec374ccd4532d8c87324b.tar.gz gnunet-23fbfdade60daf4b88cec374ccd4532d8c87324b.zip |
prefix based plugin lookup for peerinfo tool
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo_plugins.c | 12 |
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) | |||
167 | { | 167 | { |
168 | struct TransportPlugin *head = plugins_head; | 168 | struct TransportPlugin *head = plugins_head; |
169 | 169 | ||
170 | while ((head != NULL) && (0 != strcmp (name, head->short_name))) | 170 | char *stripped = GNUNET_strdup (name); |
171 | char *sep = strchr (stripped, '_'); | ||
172 | if (NULL != sep) | ||
173 | sep[0] = '\0'; | ||
174 | |||
175 | while (head != NULL) | ||
176 | { | ||
177 | if (head->short_name == strstr (head->short_name, stripped)) | ||
178 | break; | ||
171 | head = head->next; | 179 | head = head->next; |
180 | } | ||
181 | GNUNET_free (stripped); | ||
172 | if (NULL == head) | 182 | if (NULL == head) |
173 | return NULL; | 183 | return NULL; |
174 | return head->api; | 184 | return head->api; |