From cd232ed328d077ce4fde00da70197874ab292de0 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:16:49 +0200 Subject: [PATCH] Fix short-lived phar regression Regressed in 1facbc385a5ada2496bf617daed1b3e53e136a25 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. --- ext/phar/phar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 2add0135740..131bc675530 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -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--; }