Be more careful in splitting the program name from the path.

A git program can be invoked using with such a full path name:

	C:\Src\mingw-git\t\trash/..\..\git-fetch-pack.exe

i.e. it can contain both types of path separators. We must pick the one
that comes last.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2007-11-22 22:24:56 +01:00
parent d0d5661add
commit 9c906c8e6c

5
git.c
View File

@@ -399,8 +399,9 @@ int main(int argc, const char **argv)
* if we don't have anything better.
*/
#ifdef __MINGW32__
if (!slash)
slash = strrchr(cmd, '\\');
char *bslash = strrchr(cmd, '\\');
if (!slash || (bslash && bslash > slash))
slash = bslash;
#endif
if (slash) {
*slash++ = 0;