mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-11 15:46:40 +02:00
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>
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ bool __pure glob_match(char const *pat, char const *str)
|
||||
if (c == '\0') /* No possible match */
|
||||
return false;
|
||||
bool match = false, inverted = (*pat == '!');
|
||||
char const *class = pat + inverted;
|
||||
char const *class = inverted ? pat + 1 : pat;
|
||||
unsigned char a = *class++;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user