mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Fix path_lookup() when the program to invoke contains a slash.
In this case, no path lookup actually takes place, and the returned program name is equal to the passed in program name. But this code path contained a thinko that crashed.
This commit is contained in:
@@ -79,9 +79,9 @@ static char *path_lookup(const char *cmd, char **path)
|
||||
int tryexe = len < 4 || strcasecmp(cmd+len-4, ".exe");
|
||||
|
||||
if (strchr(cmd, '/') || strchr(cmd, '\\'))
|
||||
p = NULL;
|
||||
prog = xstrdup(cmd);
|
||||
|
||||
while (*p && !prog) {
|
||||
while (!prog && *p) {
|
||||
prog = lookup_prog(*p++, cmd, tryexe);
|
||||
}
|
||||
if (!prog) {
|
||||
|
||||
Reference in New Issue
Block a user