#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>
* 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)
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);
}
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
{