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 exception installing some mods (fixes #2135) #2137

Merged
merged 1 commit into from
Oct 14, 2017

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Oct 14, 2017

Path.GetDirectoryName("/a/b/c") returns "\a\b" on windows, but the regexp assumes forward slashes.
On Linux it returns "/a/b", so the problem is platform-specific.

Since the regexp didn't match on Windows, the loop would fail to find the path and raise a file not found exception, as reported in #2135. I believe only find-based netkans were affected, but unfortunately that includes DefaultInstallStanza.

Renormalizing back to forward slashes ensures the regexp will match as it should.

Path.GetDirectoryName("/a/b/c") returns "\a\b" on windows, but the
regexp assumes forward slashes.
On Linux it returns "/a/b", so the problem is platform-specific.
@HebaruSan HebaruSan assigned HebaruSan and unassigned HebaruSan Oct 14, 2017
@HebaruSan HebaruSan added Bug Windows Issues specific for Windows and removed Bug Windows Issues specific for Windows labels Oct 14, 2017
@Olympic1 Olympic1 added the Windows Issues specific for Windows label Oct 14, 2017
@HebaruSan
Copy link
Member Author

@Olympic1 , so should I merge this myself? I'm not sure how "approved these changes" fits into CKAN's typical work flow. Thanks for taking a look!

@Olympic1
Copy link
Member

Oh, I thought I pressed the merge button. Was looking on my phone.

@Olympic1 Olympic1 merged commit c85712e into KSP-CKAN:master Oct 14, 2017
@HebaruSan HebaruSan deleted the fix/grandparents-on-windows branch October 15, 2017 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Issues specific for Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants