-
Notifications
You must be signed in to change notification settings - Fork 18k
path/filepath: IsAbs considers \\host\share as a relative path but should be recognized as an absolute path #47123
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
Comments
Thank you for the bug report @MichaelEischer! Kindly cc-ing @alexbrainman @zx2c4 for when y’all have some spare time/cycles. |
Change https://golang.org/cl/333911 mentions this issue: |
Thank you for bug report @MichaelEischer . You might have a point with your reasoning, but I am not convinced we should change current behaviour. Consider this: Also, Also let's hear what @mattn has to say about this. He, probably, wrote original code. Alex |
I'd say that Doesn't the IsAbs/Volume asymmetry already apply to
doesn't work, whereas
does. |
Maybe this can give some help. |
I agree with this change. #include <stdio.h>
#include <stdlib.h>
int
main(int argc, char* argv[]) {
char* paths[] = {
"C:",
"C:\\",
"C:temp",
"C:\\temp",
"\\\\127.0.0.1",
"\\\\127.0.0.1\\",
"\\\\127.0.0.1\\C$",
"\\\\127.0.0.1\\C$\\",
NULL
};
for (char **p = paths; *p; p++) {
char path[_MAX_PATH];
char* res = _fullpath(path, *p, sizeof(path));
printf("%s is %s\n", *p, res);
}
return 0;
}
(This is obviously thing) |
Ah, it's wrong (fixing path not path/filepath) |
Change https://golang.org/cl/334809 mentions this issue: |
Indeed. Alex |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
1.16.5 is the latest release at the moment.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
According to https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths "UNC paths must always be fully qualified." which suggests that there are no relative UNC paths, and thus
\\host\share
should also be considered as absolute path.The text was updated successfully, but these errors were encountered: