mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
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:
5
git.c
5
git.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user