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
Ensure user paths are stored in a consistent manner. #10241
Ensure user paths are stored in a consistent manner. #10241
Conversation
4cab2e4
to
6613492
Compare
|
What happens if the user enters a path incorrectly, say using backslash instead of forwardslash? What is the experience that the user will get when that occurs? Does it just fix it for them or will it alert them? Also, isn't backslash \ used for paths on windows? I guess this isn't accounting for OS differences like that? |
|
We've already been using If the user enters a backslash on Windows it will just get silently replaced with a forward slash internally. |
| @@ -34,10 +34,9 @@ void NANDImporter::ImportNANDBin(const std::string& path_to_bin, | |||
| if (!ReadNANDBin(path_to_bin, get_otp_dump_path)) | |||
| return; | |||
|
|
|||
| const std::string nand_root = File::GetUserPath(D_WIIROOT_IDX); | |||
| std::string nand_root = File::GetUserPath(D_WIIROOT_IDX); | |||
| nand_root.pop_back(); // remove trailing path separator | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it doesn't matter if this path has a trailing separator, the only piece of code that does (or did) care is to make debug logs a little nicer to look at. So I don't think this line is needed but feel free to do it anyways.
PS: Annoyed by my old code in either case, I made a quick refactor that completely removes the weird _length variable (and a few other things) at Starsam80@8911c3b which I might make a PR for if I ever get enough energy.
d5bcfd8
to
d7c52f6
Compare
d7c52f6
to
269ae6f
Compare
That is: