1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix short-lived phar regression

Regressed in 1facbc385a
The macro caused the value to be read over and over, but the change to
a variable makes the condition not work like before. Just inline the
read.
This commit is contained in:
Niels Dossche
2024-09-12 23:16:49 +02:00
parent 9f0138babe
commit cd232ed328

View File

@@ -2180,9 +2180,7 @@ char *phar_fix_filepath(char *path, size_t *new_len, int use_cwd) /* {{{ */
ptr_length = ptr - tok;
last_time:
if (IS_DIRECTORY_UP(tok, ptr_length)) {
const char previous = newpath[newpath_len - 1];
while (newpath_len > 1 && !IS_BACKSLASH(previous)) {
while (newpath_len > 1 && !IS_BACKSLASH(newpath[newpath_len - 1])) {
newpath_len--;
}