gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6914 - in GNUnet/src/applications/fs: ecrs namespace


From: gnunet
Subject: [GNUnet-SVN] r6914 - in GNUnet/src/applications/fs: ecrs namespace
Date: Tue, 27 May 2008 06:49:15 -0600 (MDT)

Author: grothoff
Date: 2008-05-27 06:49:14 -0600 (Tue, 27 May 2008)
New Revision: 6914

Modified:
   GNUnet/src/applications/fs/ecrs/uri.c
   GNUnet/src/applications/fs/namespace/names.c
Log:
cleaner

Modified: GNUnet/src/applications/fs/ecrs/uri.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/uri.c       2008-05-27 12:47:16 UTC (rev 
6913)
+++ GNUnet/src/applications/fs/ecrs/uri.c       2008-05-27 12:49:14 UTC (rev 
6914)
@@ -303,6 +303,8 @@
       n += strlen (keyword) - 1;
       if (NULL != strstr (&keyword[1], " "))
         n += 2;
+      if (keyword[0] == '+')
+       n++;
     }
   ret = GNUNET_malloc (n);
   strcpy (ret, "");
@@ -312,11 +314,20 @@
       if (NULL != strstr (&keyword[1], " "))
         {
           strcat (ret, "\"");
-          strcat (ret, &keyword[1]);
+         if (keyword[0] == '+')
+           strcat (ret, keyword);
+         else
+           strcat (ret, &keyword[1]);
           strcat (ret, "\"");
         }
       else
-        strcat (ret, &keyword[1]);
+       {
+         if (keyword[0] == '+')
+           strcat (ret, keyword);
+         else
+           strcat (ret, &keyword[1]);
+       }
+      strcat(ret, " ");
     }
   return ret;
 }

Modified: GNUnet/src/applications/fs/namespace/names.c
===================================================================
--- GNUnet/src/applications/fs/namespace/names.c        2008-05-27 12:47:16 UTC 
(rev 6913)
+++ GNUnet/src/applications/fs/namespace/names.c        2008-05-27 12:49:14 UTC 
(rev 6914)
@@ -55,21 +55,27 @@
 
   meta = NULL;
   name = NULL;
-  GNUNET_NS_internal_read_namespace_info_ (ectx, cfg, nsid, &meta, NULL,
-                                           &name);
-  if ((meta != NULL) && (name == NULL))
-    name = GNUNET_ECRS_meta_data_get_first_by_types (meta,
-                                                     EXTRACTOR_TITLE,
-                                                     EXTRACTOR_FILENAME,
-                                                     EXTRACTOR_DESCRIPTION,
-                                                     EXTRACTOR_SUBJECT,
-                                                     EXTRACTOR_PUBLISHER,
-                                                     EXTRACTOR_AUTHOR,
-                                                     EXTRACTOR_COMMENT,
-                                                     EXTRACTOR_SUMMARY,
-                                                     EXTRACTOR_OWNER, -1);
-  if (meta != NULL)
-    GNUNET_ECRS_meta_data_destroy (meta);
+  if (GNUNET_OK == 
+      GNUNET_NS_internal_read_namespace_info_ (ectx, cfg, nsid, &meta, NULL,
+                                              &name))
+    {
+      if ((meta != NULL) && (name == NULL))
+       name = GNUNET_ECRS_meta_data_get_first_by_types (meta,
+                                                        EXTRACTOR_TITLE,
+                                                        EXTRACTOR_FILENAME,
+                                                        EXTRACTOR_DESCRIPTION,
+                                                        EXTRACTOR_SUBJECT,
+                                                        EXTRACTOR_PUBLISHER,
+                                                        EXTRACTOR_AUTHOR,
+                                                        EXTRACTOR_COMMENT,
+                                                        EXTRACTOR_SUMMARY,
+                                                        EXTRACTOR_OWNER, -1);
+      if (meta != NULL)
+       {
+         GNUNET_ECRS_meta_data_destroy (meta);
+         meta = NULL;
+       }
+    }
   if (name == NULL)
     name = GNUNET_strdup (_("no-name"));
   GNUNET_hash (name, strlen (name), &nh);





reply via email to

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