Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8230: Resolve ".." when opening files in .tar #8231

Merged
merged 1 commit into from Jun 22, 2020
Merged

Conversation

@glx22
Copy link
Contributor

@glx22 glx22 commented Jun 20, 2020

Possible solution. Not sure if my algorithm is optimal (but at least it's easy to understand).

Copy link
Member

@LordAro LordAro left a comment

I know this isn't exactly a performance hotspot, but...

src/fileio.cpp Outdated Show resolved Hide resolved
}
tokens.pop_back();
resolved_name[0] = '\0';
for (std::string token : tokens) {

This comment has been minimized.

@LordAro

LordAro Jun 21, 2020
Member

Suggested change
for (std::string token : tokens) {
for (const std::string &token : tokens) {
src/fileio.cpp Outdated Show resolved Hide resolved
src/fileio.cpp Outdated Show resolved Hide resolved
@glx22 glx22 force-pushed the glx22:fix_8230 branch from ea997e7 to df67297 Jun 21, 2020
@glx22 glx22 merged commit 87a069c into OpenTTD:master Jun 22, 2020
8 checks passed
8 checks passed
Commit checker
Details
OpenTTD CI Build #20200621.2 succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.9) Linux linux-amd64-clang-3.9 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@glx22 glx22 deleted the glx22:fix_8230 branch Jun 22, 2020
LordAro added a commit to LordAro/OpenTTD that referenced this pull request Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.