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/dir.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-10-08 14:05:43 +0300
committerJunio C Hamano <gitster@pobox.com>2022-10-09 08:09:03 +0300
commitf7669676d0e9aedd814645ca82a5b86980fb7740 (patch)
treea584eef804eb425750a451a9c2acacd25b3a9cc6 /dir.c
parenta0feb8611d4c0b2b5d954efe4e98207f62223436 (diff)
dir: use fspathncmp() in pl_hashmap_cmp()
Call fspathncmp() instead of open-coding it. This shortens the code and makes it less repetitive. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index d7cfb08e44..7500ff1622 100644
--- a/dir.c
+++ b/dir.c
@@ -669,9 +669,7 @@ int pl_hashmap_cmp(const void *unused_cmp_data,
? ee1->patternlen
: ee2->patternlen;
- if (ignore_case)
- return strncasecmp(ee1->pattern, ee2->pattern, min_len);
- return strncmp(ee1->pattern, ee2->pattern, min_len);
+ return fspathncmp(ee1->pattern, ee2->pattern, min_len);
}
static char *dup_and_filter_pattern(const char *pattern)