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
src/fileio.cpp Outdated
}
tokens.pop_back();
resolved_name[0] = '\0';
for (std::string token : tokens) {
Copy link
Member

@LordAro LordAro Jun 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 merged commit 87a069c into OpenTTD:master Jun 22, 2020
8 checks passed
@glx22 glx22 deleted the fix_8230 branch Jun 22, 2020
@LordAro LordAro added the backport requested label Jul 27, 2020
@glx22 glx22 added backported and removed backport requested labels Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants