Merge branch 'fix-non-exe-externals' of https://github.com/aroben/git into devel

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2012-06-05 16:40:56 -05:00

View File

@@ -989,11 +989,12 @@ static char *lookup_prog(const char *dir, const char *cmd, int isexe, int exe_on
if (!isexe && _waccess(wpath, F_OK) == 0) if (!isexe && _waccess(wpath, F_OK) == 0)
return xstrdup(path); return xstrdup(path);
path[strlen(path)-4] = '\0'; wpath[wcslen(wpath)-4] = '\0';
if ((!exe_only || isexe) && _waccess(wpath, F_OK) == 0) { if ((!exe_only || isexe) && _waccess(wpath, F_OK) == 0) {
if (!(GetFileAttributesW(wpath) & FILE_ATTRIBUTE_DIRECTORY)) {
if (!(GetFileAttributesW(wpath) & FILE_ATTRIBUTE_DIRECTORY)) path[strlen(path)-4] = '\0';
return xstrdup(path); return xstrdup(path);
}
} }
return NULL; return NULL;
} }