From a8f357cffdf7242b86e3b0e276034069e1be13c2 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 7 Nov 2012 17:55:54 +0100 Subject: concat-deps: on Windows, compare paths case-insensitively Change-Id: I5e5d9b39cb0440644bf3ffb8dca4913dc123f672 --- solenv/bin/concat-deps.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'solenv') diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index 44d83f195459..c6177ce038ed 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -97,9 +97,11 @@ #ifdef __windows #define FILE_O_RDONLY _O_RDONLY #define FILE_O_BINARY _O_BINARY +#define PATHNCMP strncasecmp /* MSVC converts paths to lower-case sometimes? */ #else /* not windaube */ #define FILE_O_RDONLY O_RDONLY #define FILE_O_BINARY 0 +#define PATHNCMP strncmp #endif /* not windaube */ #ifndef TRUE @@ -730,7 +732,7 @@ elide_dependency(const char* key, int key_len, #endif /* .hdl files are always matched by .hpp */ - if (key_len > 4 && !strncmp(key + key_len - 4, ".hdl", 4)) + if (key_len > 4 && !PATHNCMP(key + key_len - 4, ".hdl", 4)) return 1; /* boost brings a plague of header files */ @@ -746,13 +748,13 @@ elide_dependency(const char* key, int key_len, { if (0 == boost) { - if (!strncmp(key + i + 1, "solver/", 7)) + if (!PATHNCMP(key + i + 1, "solver/", 7)) { boost++; continue; } } - else if (!strncmp(key + i + 1, "inc/external/boost/", 19)) + else if (!PATHNCMP(key + i + 1, "inc/external/boost/", 19)) { if (boost_count) (*boost_count)++; @@ -761,7 +763,7 @@ elide_dependency(const char* key, int key_len, } if (0 == unpacked) { - if (!strncmp(key + i + 1, "workdir/", 8)) + if (!PATHNCMP(key + i + 1, "workdir/", 8)) { unpacked = 1; continue; @@ -769,7 +771,7 @@ elide_dependency(const char* key, int key_len, } else { - if (!strncmp(key + i + 1, "UnpackedTarball/", 16)) + if (!PATHNCMP(key + i + 1, "UnpackedTarball/", 16)) { if (unpacked_end) *unpacked_end = strchr(key + i + 17, '/'); -- cgit