From 93bdde3af2a303cdc72bce2aa59b11f9c0aebd0c Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Sat, 14 Dec 2013 10:02:21 +1100 Subject: [PATCH] winebuild: Use correct PATH separator on Windows. --- tools/winebuild/utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index d92a73119d..e838165f82 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -39,6 +39,12 @@ #include "build.h" +#ifdef _WIN32 +# define PATH_SEPARATOR ';' +#else +# define PATH_SEPARATOR ':' +#endif + static const char **tmp_files; static unsigned int nb_tmp_files; static unsigned int max_tmp_files; @@ -319,13 +325,13 @@ struct strarray *find_tool( const char *name, const char * const *names ) if (!getenv( "PATH" )) return NULL; path = xstrdup( getenv( "PATH" )); - for (p = path, count = 2; *p; p++) if (*p == ':') count++; + for (p = path, count = 2; *p; p++) if (*p == PATH_SEPARATOR) count++; dirs = xmalloc( count * sizeof(*dirs) ); count = 0; dirs[count++] = p = path; while (*p) { - while (*p && *p != ':') p++; + while (*p && *p != PATH_SEPARATOR) p++; if (!*p) break; *p++ = 0; dirs[count++] = p;