-
-
Notifications
You must be signed in to change notification settings - Fork 741
Windows's altsep support in getExt, getName and join (bugfix, I think) #63
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
Conversation
… think). Some cosmetic changes.
template Char type in private functions => dchar
Before you spend a lot more time on this, I should probably mention that I have written a new version of std.path which I intend to put up for review for inclusion in Phobos as soon as possible. It correctly handles both dir separators on Windows. |
Lars, what do we do this? I think it's safe to approve it. |
s/do this/do with this/ |
It's probably safe, but it may be that there isn't much point in doing so. Based on feedback I've gotten so far, I feel quite certain that my revamped std.path will be accepted in some form or other. It is ready for review now, and it should be next in line after the TempAlloc review is over. Hopefully it will be included with DMD 2.055. At any rate, if we do approve this pull request, I just noticed two lines that should be fixed. I'll comment on them separately. |
|
||
static assert(sep.length == 1 && altsep.length == 1); | ||
private bool isSep(dchar ch) { | ||
return (ch == sep[0]) | (ch == altsep[0]); |
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.
This should be a boolean or.
return (ch == sep[0]) || (ch == altsep[0]);
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.
Why?
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.
For consistency (you use ||
everywhere else) and clarity of intent (it is a boolean operation). I know the bitwise OR works, I just think it looks strange.
Ping? Both '|' and '||' work here, but probably the use of '|' is a bit surprising. So let's change that to '||' and commit soon. Thanks! |
Pushed "ping accepted" commit denis-sh/phobos@d3c7cfd to denis-sh:patch-3. No idea where is it. |
Hm. Let me pull this now. No need to make the change in a subsequent pull request (I think we're okay either way). Thanks! |
Windows's altsep support in getExt, getName and join (bugfix, I think)
Windows's altsep support in getExt, getName and join (bugfix, I think)
Added Windows's altsep support to getExt, getName and join (bugfix, I think).
Some cosmetic changes.