summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2018-10-25 16:13:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-26 02:20:01 (GMT)
commit3063477445423fd5ec52efa073fb8d15c1641f4e (patch)
tree74f8bcf47c281305d24597044feed78c8f452046 /path.c
parent6e9e91e9cae74cd7feb9300563d40361b2b17dd2 (diff)
downloadgit-3063477445423fd5ec52efa073fb8d15c1641f4e.zip
git-3063477445423fd5ec52efa073fb8d15c1641f4e.tar.gz
git-3063477445423fd5ec52efa073fb8d15c1641f4e.tar.bz2
path.c: char is not (always) signed
If a "char" in C is signed or unsigned is not specified, because it is out of tradition "implementation dependent". Therefore constructs like "if (name[i] < 0)" are not portable, use "if (name[i] & 0x80)" instead. Detected by "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516" when setting DEVELOPER = 1 DEVOPTS = extra-all Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
-rw-r--r--path.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/path.c b/path.c
index 4c4a751..cd31734 100644
--- a/path.c
+++ b/path.c
@@ -1368,7 +1368,7 @@ only_spaces_and_periods:
saw_tilde = 1;
} else if (i >= 6)
return 0;
- else if (name[i] < 0) {
+ else if (name[i] & 0x80) {
/*
* We know our needles contain only ASCII, so we clamp
* here to make the results of tolower() sane.