diff options
-rw-r--r-- | miscutils/make.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 0235d9877..06917a867 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
@@ -1243,6 +1243,28 @@ find_char(const char *str, int c) | |||
1243 | return NULL; | 1243 | return NULL; |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | #if ENABLE_PLATFORM_MINGW32 | ||
1247 | /* | ||
1248 | * Check for a target rule by searching for a colon that isn't | ||
1249 | * part of a Windows path. Return a pointer to the colon or NULL. | ||
1250 | */ | ||
1251 | static char * | ||
1252 | find_colon(char *p) | ||
1253 | { | ||
1254 | char *q; | ||
1255 | |||
1256 | for (q = p; (q = strchr(q, ':')); ++q) { | ||
1257 | if (posix && !(pragma & P_WINDOWS)) | ||
1258 | break; | ||
1259 | if (q == p || !isalpha(q[-1]) || q[1] != '/') | ||
1260 | break; | ||
1261 | } | ||
1262 | return q; | ||
1263 | } | ||
1264 | #else | ||
1265 | # define find_colon(s) find_char(s, ':') | ||
1266 | #endif | ||
1267 | |||
1246 | /* | 1268 | /* |
1247 | * Recursively expand any macros in str to an allocated string. | 1269 | * Recursively expand any macros in str to an allocated string. |
1248 | */ | 1270 | */ |
@@ -2115,7 +2137,7 @@ input(FILE *fd, int ilevel) | |||
2115 | p = expanded = expand_macros(str, FALSE); | 2137 | p = expanded = expand_macros(str, FALSE); |
2116 | 2138 | ||
2117 | // Look for colon separator | 2139 | // Look for colon separator |
2118 | q = find_char(p, ':'); | 2140 | q = find_colon(p); |
2119 | if (q == NULL) | 2141 | if (q == NULL) |
2120 | error("expected separator"); | 2142 | error("expected separator"); |
2121 | 2143 | ||