gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27954 - gnunet/src/peerinfo-tool


From: gnunet
Subject: [GNUnet-SVN] r27954 - gnunet/src/peerinfo-tool
Date: Fri, 12 Jul 2013 15:04:38 +0200

Author: wachs
Date: 2013-07-12 15:04:38 +0200 (Fri, 12 Jul 2013)
New Revision: 27954

Modified:
   gnunet/src/peerinfo-tool/gnunet-peerinfo_plugins.c
Log:
substring search is the root of all evil:
peerinfo did load wrong plugin if substring matches: used https for http 
address 


Modified: gnunet/src/peerinfo-tool/gnunet-peerinfo_plugins.c
===================================================================
--- gnunet/src/peerinfo-tool/gnunet-peerinfo_plugins.c  2013-07-12 12:59:22 UTC 
(rev 27953)
+++ gnunet/src/peerinfo-tool/gnunet-peerinfo_plugins.c  2013-07-12 13:04:38 UTC 
(rev 27954)
@@ -168,14 +168,23 @@
   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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]