Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/glob: clean up "bool abuse" in pointer arithmetic

Replace the implicit 'bool' to 'int' conversion with an explicit ternary
operator. This makes the pointer arithmetic clearer and avoids relying on
boolean memory representation for logic flow.

Link: https://lkml.kernel.org/r/20260301203845.2617217-1-objecting@objecting.org
Signed-off-by: Josh Law <objecting@objecting.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Josh Law and committed by
Andrew Morton
90c73d0b 33a3dd9b

+1 -1
+1 -1
lib/glob.c
··· 73 73 if (c == '\0') /* No possible match */ 74 74 return false; 75 75 bool match = false, inverted = (*pat == '!'); 76 - char const *class = pat + inverted; 76 + char const *class = inverted ? pat + 1 : pat; 77 77 unsigned char a = *class++; 78 78 79 79 /*