-
Notifications
You must be signed in to change notification settings - Fork 4
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
isAbsolute(r'\') should return false for Windows-style filesystem #544
Comments
From the documentation of It's doesn't do that. Tested on DartPad: import "package:path/path.dart" as path;
void main() {
var c = path.Context(style: path.Style.windows);
print(c.isAbsolute(r'')); // false
print(c.isAbsolute(r'\')); // true ??
print(c.isAbsolute(r'\\')); // true
print(c.isAbsolute(r'a:')); // false
print(c.isAbsolute(r'a:\')); // true
} I think the bug is in this line: if (path.length < 2 || path.codeUnitAt(1) != chars.backslash) return 1; where it should return if (path.length < 2) return 0;
if (path.codeUnitAt(1) != chars.backslash) return 1; |
Yes. When I wrote "The expectation is that |
OK, I'm happy to close the issue. |
No no, |
As per comment by @jamesderlin at https://github.com/google/file.dart/issues/198#issuecomment-1518274694 on the issue related to the file package,
The text was updated successfully, but these errors were encountered: