gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r7101 - GNUnet/src/applications/fs/tools


From: gnunet
Subject: [GNUnet-SVN] r7101 - GNUnet/src/applications/fs/tools
Date: Sun, 8 Jun 2008 23:57:44 -0600 (MDT)

Author: grothoff
Date: 2008-06-08 23:57:44 -0600 (Sun, 08 Jun 2008)
New Revision: 7101

Modified:
   GNUnet/src/applications/fs/tools/gnunet-auto-share.c
Log:
fixing directory handling

Modified: GNUnet/src/applications/fs/tools/gnunet-auto-share.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-auto-share.c        2008-06-09 
05:54:03 UTC (rev 7100)
+++ GNUnet/src/applications/fs/tools/gnunet-auto-share.c        2008-06-09 
05:57:44 UTC (rev 7101)
@@ -186,8 +186,9 @@
     return GNUNET_OK;
   if (ul != NULL)
     return GNUNET_SYSERR;
-  fn = GNUNET_malloc (strlen (filename) + strlen (dirName) + 1);
+  fn = GNUNET_malloc (strlen (filename) + strlen (dirName) + 2);
   strcpy (fn, dirName);
+  strcat (fn, DIR_SEPARATOR_STR);
   strcat (fn, filename);
   if (0 != stat (fn, &buf))
     {
@@ -252,7 +253,13 @@
   EXTRACTOR_KeywordType max;
   char *value;
 
-  if (0 != strcmp (amc->filename, section))
+  if ( (0 != strcmp (amc->filename, section)) &&
+       ( (0 != strncmp (amc->filename,
+                       section,
+                       strlen(amc->filename))) ||
+        (strlen(section) != strlen(amc->filename) + 1) ||
+        ( (section[strlen(section)-1] != '/') &&
+          (section[strlen(section)-1] != '\\') ) ) )
     return 0;
   max = EXTRACTOR_getHighestKeywordTypeNumber ();
   for (type = 0; type < max; type++)





reply via email to

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