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

Fixed case-insensitive name check in checkSketchFile #11554

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

magedrifaat
Copy link
Contributor

This commit fixes #8030

It turns out that on case-insensitive file systems, the "file.exists" check will return true even if the file that actually exists differs from the file being checked in the case of the letters. (i.e. "Test.ino" will be considered to exist even if the actual file name is "test.ino").
The proposed solution is to make use of the function getCanonicalFile as suggested in this StackOverflow answer to get the actual file name and compare it to the expected name.

I decided to implement a function in FileUtils for better code reuse but it could have been inlined as well since this is its only use-case currently.

All Submissions:

  • [ x ] Have you followed the guidelines in our Contributing document?
  • [ x ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • [ x ] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [ x ] Have you successfully ran tests with your changes

@CLAassistant
Copy link

CLAassistant commented May 22, 2021

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Case difference in the sketch folder and file name causes the IDE to try to compile the wrong file
2 participants