use IS_SLASH in various places instead of string comparing#21814
use IS_SLASH in various places instead of string comparing#21814LamentXU123 wants to merge 5 commits intophp:masterfrom
IS_SLASH in various places instead of string comparing#21814Conversation
There was a problem hiding this comment.
You missed some, for example
php-src/ext/phar/phar_object.c
Line 3568 in 95a17af
Please do the search with a robust tool, not with regular expressions. The following Coccinelle patch can be a good start:
@@
char x;
@@
* (x == '/' || x == '\\')
@@
char x;
@@
* (x == '\\' || x == '/')
No this is intented... If we change this the test on ext/phar/tests/bug64931/bug64931.phpt will fail. See https://github.com/php/php-src/actions/runs/24648588020/job/72066292649 as I've said I manually deleted some changes
Yeah I'll try now, thank you :) |
That's not how C works. |
we have a defined
IS_SLASHfunction:So to make things more legible we can use
IS_SLASH(XXX)instead ofXXX == '\\' || XXX == '/'I search all occasions by this command:
and manually remove some improper occasions :)