mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 15:47:35 -04:00
go.sys/windows: apply latest syscall changes
71db3dc120af os: make SameFile handle paths like c:a.txt properly ff34a3e84dc0 net: fix CNAME resolving on Windows LGTM=r R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/130250043
This commit is contained in:
@@ -130,9 +130,8 @@ func SetNonblock(fd Handle, nonblocking bool) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// getFullPath retrieves the full path of the specified file.
|
||||
// Just a wrapper for Windows GetFullPathName api.
|
||||
func getFullPath(name string) (path string, err error) {
|
||||
// FullPath retrieves the full path of the specified file.
|
||||
func FullPath(name string) (path string, err error) {
|
||||
p, err := UTF16PtrFromString(name)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -161,7 +160,7 @@ func isSlash(c uint8) bool {
|
||||
}
|
||||
|
||||
func normalizeDir(dir string) (name string, err error) {
|
||||
ndir, err := getFullPath(dir)
|
||||
ndir, err := FullPath(dir)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -200,9 +199,9 @@ func joinExeDirAndFName(dir, p string) (name string, err error) {
|
||||
return "", err
|
||||
}
|
||||
if volToUpper(int(p[0])) == volToUpper(int(d[0])) {
|
||||
return getFullPath(d + "\\" + p[2:])
|
||||
return FullPath(d + "\\" + p[2:])
|
||||
} else {
|
||||
return getFullPath(p)
|
||||
return FullPath(p)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -212,9 +211,9 @@ func joinExeDirAndFName(dir, p string) (name string, err error) {
|
||||
return "", err
|
||||
}
|
||||
if isSlash(p[0]) {
|
||||
return getFullPath(d[:2] + p)
|
||||
return FullPath(d[:2] + p)
|
||||
} else {
|
||||
return getFullPath(d + "\\" + p)
|
||||
return FullPath(d + "\\" + p)
|
||||
}
|
||||
}
|
||||
// we shouldn't be here
|
||||
|
||||
Reference in New Issue
Block a user