Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@andrewfinnell
Copy link

Check if ending of Directory.GetCurrentDirectory() ends in DirectorySeparatorChar and don't append if it does.

Was concerned about UNC paths, but '\' is invalid. This means that even if GetCurrentDirectory() happened to return a '' an extra DirectorySeparatorChar is invalid.

@gonzalop
Copy link
Contributor

Isn't the issue solved with "if (cwd == DirectorySeparatorStr) ..."?

@andrewfinnell
Copy link
Author

No, because this is also broken on windows. Change your cwd to C:\ then echo the results of Path.GetFullPath("test.txt"). It returned "C:\test.txt"

@andrewfinnell
Copy link
Author

I just realized I dont think my fix works on Windows. Will reevaluate. I noticed the check for ''. I am working on normalizing 95% of the MonoIO operations so all these checks don't need to happen (In my own project, not these commits). It would be nice to treat the File System in which Mono is running on the same way, except for a few minor mapping calls. I'll check this fix on Windows and resubmit another commit if needed.

@alexrp
Copy link
Contributor

alexrp commented Oct 21, 2013

ping?

@alexrp
Copy link
Contributor

alexrp commented May 22, 2014

Closing this due to inactivity, but feel free to resubmit. Thanks!

@alexrp alexrp closed this May 22, 2014
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…rrent bblock using a conditional branch whose two targets are the same. Fixes mono/mono#171.

Commit migrated from mono/mono@50d820a
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.

5 participants