Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-02-22 21:51:19 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-24 20:30:31 +0300
commit2ce6d075fa35e4ea4a581c809eca3ad5631c9079 (patch)
tree163d09de764ab4a8ac97037eeebbc8108a3a6b36 /compat
parent2b3c430bcea5d8c40b218c7e2a71d261822c6a52 (diff)
use strpbrk(3) to search for characters from a given set
We can check if certain characters are present in a string by calling strchr(3) on each of them, or we can pass them all to a single strpbrk(3) call. The latter is shorter, less repetitive and slightly more efficient, so let's do that instead. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 402c1ad91c..7ec6c04dfc 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1232,7 +1232,7 @@ static char *path_lookup(const char *cmd, int exe_only)
int len = strlen(cmd);
int isexe = len >= 4 && !strcasecmp(cmd+len-4, ".exe");
- if (strchr(cmd, '/') || strchr(cmd, '\\'))
+ if (strpbrk(cmd, "/\\"))
return xstrdup(cmd);
path = mingw_getenv("PATH");