Skip to content

Commit 6291f97

Browse files
committed
phar: Move code to avoid goto
1 parent 0098f3e commit 6291f97

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/phar/dirstream.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has
188188
entry = safe_emalloc(keylen, 1, 1);
189189
memcpy(entry, ZSTR_VAL(str_key), keylen);
190190
entry[keylen] = '\0';
191-
192-
goto PHAR_ADD_ENTRY;
193191
} else {
194192
if (0 != memcmp(ZSTR_VAL(str_key), dir, dirlen)) {
195193
/* entry in directory not found */
@@ -199,7 +197,6 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has
199197
continue;
200198
}
201199
}
202-
}
203200

204201
const char *save = ZSTR_VAL(str_key);
205202
save += dirlen + 1; /* seek to just past the path separator */
@@ -220,7 +217,8 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has
220217
entry[keylen - dirlen - 1] = '\0';
221218
keylen = keylen - dirlen - 1;
222219
}
223-
PHAR_ADD_ENTRY:
220+
}
221+
224222
if (keylen) {
225223
/**
226224
* Add an empty element to avoid duplicates

0 commit comments

Comments
 (0)