Skip to content

fileinfo: don't compile libmagic/strcasestr.c#21522

Merged
iluuu1994 merged 3 commits intophp:masterfrom
orlitzky:fileinfo-doesnt-use-strcasestr
Mar 25, 2026
Merged

fileinfo: don't compile libmagic/strcasestr.c#21522
iluuu1994 merged 3 commits intophp:masterfrom
orlitzky:fileinfo-doesnt-use-strcasestr

Conversation

@orlitzky
Copy link
Contributor

Split from #21472

PHP's copy of libmagic does not use the strcasestr() function, so there is no need to check for it or compile the fallback implementation.

This leaves libmagic/strcasestr.c unused, but since we are maintaining a patch against upstream libmagic, removing the file (and including the removal in the patch) is not a clear win.

PHP's copy of libmagic doesn't use the strcasestr() function,
so there is no reason to prototype it, regardless of whether
or not the OS (libc) provides it.
Run ext/fileinfo/generate_patch.sh to re-roll this patch, a recent
commit removes HAVE_STRCASESTR from PHP's copy of libmagic.
Unlike the upstream library, PHP's copy of libmagic doesn't use the
strcasestr() function, so there is no reason to include strcasestr.c
in the list of source files.
@iluuu1994 iluuu1994 merged commit 4139422 into php:master Mar 25, 2026
19 checks passed
@iluuu1994
Copy link
Member

Thank you @orlitzky!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants