Skip to content

Commit bb532b5

Browse files
rimrulgitster
authored andcommitted
run-command: conditionally define locate_in_PATH()
This commit doesn't change any behaviour by itself, but allows us to easily define compat replacements for locate_in_PATH(). It prepares us for the next commit that adds a native Windows implementation of locate_in_PATH(). Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fb7d80e commit bb532b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

run-command.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ int is_executable(const char *name)
170170
return st.st_mode & S_IXUSR;
171171
}
172172

173+
#ifndef locate_in_PATH
173174
/*
174175
* Search $PATH for a command. This emulates the path search that
175176
* execvp would perform, without actually executing the command so it
@@ -218,6 +219,7 @@ static char *locate_in_PATH(const char *file)
218219
strbuf_release(&buf);
219220
return NULL;
220221
}
222+
#endif
221223

222224
int exists_in_PATH(const char *command)
223225
{

0 commit comments

Comments
 (0)