gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21983 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r21983 - gnunet/src/util
Date: Thu, 14 Jun 2012 07:26:09 +0200

Author: grothoff
Date: 2012-06-14 07:26:09 +0200 (Thu, 14 Jun 2012)
New Revision: 21983

Modified:
   gnunet/src/util/os_installation.c
Log:
-LRN: fix binary checker to use proper API

Modified: gnunet/src/util/os_installation.c
===================================================================
--- gnunet/src/util/os_installation.c   2012-06-13 22:04:47 UTC (rev 21982)
+++ gnunet/src/util/os_installation.c   2012-06-14 05:26:09 UTC (rev 21983)
@@ -33,6 +33,7 @@
 #include "gnunet_configuration_lib.h"
 #include "gnunet_disk_lib.h"
 #include "gnunet_os_lib.h"
+#include "gnunet_strings_lib.h"
 #if DARWIN
 #include <mach-o/ldsyms.h>
 #include <mach-o/dyld.h>
@@ -443,7 +444,8 @@
  * Attempts to find the file using the current
  * PATH environment variable as a search path.
  *
- * @param binary the name of the file to check
+ * @param binary the name of the file to check.
+ *        W32: must not have an .exe suffix.
  * @return GNUNET_YES if the file is SUID,
  *         GNUNET_NO if not SUID (but binary exists)
  *         GNUNET_SYSERR on error (no such binary or not executable)
@@ -459,8 +461,9 @@
   char *binaryexe;
 
   GNUNET_asprintf (&binaryexe, "%s.exe", binary);
-  if (DIR_SEPARATOR == binary[0])
-    p = GNUNET_strdup (binary);
+  if (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (binaryexe, GNUNET_NO,
+      NULL, NULL))
+    p = GNUNET_strdup (binaryexe);
   else
   {
     p = get_path_from_PATH (binaryexe);
@@ -473,7 +476,8 @@
   }
   GNUNET_free (binaryexe);
 #else
-  if (DIR_SEPARATOR == binary[0])
+  if (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (binary, GNUNET_NO,
+      NULL, NULL))
     p = GNUNET_strdup (binary);
   else
   {




reply via email to

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