From: VMware, Inc <> Date: Thu, 24 Feb 2011 21:57:36 +0000 (-0800) Subject: Changes in shared code that don't affect open-vm-tools functionality. X-Git-Tag: 2011.02.23-368700~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=490ddcabec4b32b76b124fb57495ab691767d0dd;p=thirdparty%2Fopen-vm-tools.git Changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/file/file.c b/open-vm-tools/lib/file/file.c index 38c356723..c11c4da17 100644 --- a/open-vm-tools/lib/file/file.c +++ b/open-vm-tools/lib/file/file.c @@ -2165,12 +2165,23 @@ File_MapPathPrefix(const char *oldPath, // IN: /* * If the prefix matches on a DIRSEPS boundary, or the prefix is the * whole string, replace it. + * * If we don't insist on matching a whole directory name, we could * mess things of if one directory is a substring of another. + * + * Perform a case-insensitive compare on Windows. (There are + * case-insensitive filesystems on MacOS also, but the problem + * is more acute with Windows because of frequent drive-letter + * case mismatches. So in lieu of actually asking the + * filesystem, let's just go with a simple ifdef for now.) */ if ((oldPathLen >= oldPrefixLen) && - (memcmp(oldPath, oldPrefix, oldPrefixLen) == 0) && +#ifdef _WIN32 + (Str_Strncasecmp(oldPath, oldPrefix, oldPrefixLen) == 0) && +#else + (Str_Strncmp(oldPath, oldPrefix, oldPrefixLen) == 0) && +#endif (strchr(VALID_DIRSEPS, oldPath[oldPrefixLen]) || (oldPath[oldPrefixLen] == '\0'))) { size_t newPrefixLen = strlen(newPrefix);