mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +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:
parent
33a3dd9bfd
commit
90c73d0bfa
|
|
@ -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++;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user