Skip to content

Commit cd232ed

Browse files
committed
Fix short-lived phar regression
Regressed in 1facbc3 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.
1 parent 9f0138b commit cd232ed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ext/phar/phar.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,9 +2180,7 @@ char *phar_fix_filepath(char *path, size_t *new_len, int use_cwd) /* {{{ */
21802180
ptr_length = ptr - tok;
21812181
last_time:
21822182
if (IS_DIRECTORY_UP(tok, ptr_length)) {
2183-
const char previous = newpath[newpath_len - 1];
2184-
2185-
while (newpath_len > 1 && !IS_BACKSLASH(previous)) {
2183+
while (newpath_len > 1 && !IS_BACKSLASH(newpath[newpath_len - 1])) {
21862184
newpath_len--;
21872185
}
21882186

0 commit comments

Comments
 (0)