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

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

Choose a reason for hiding this comment

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

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

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
@glx22 glx22 deleted the fix_8230 branch June 22, 2020 12:21
@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label Jul 27, 2020
LordAro pushed a commit to LordAro/OpenTTD that referenced this pull request Jul 30, 2020
@glx22 glx22 added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants