Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Delta Between Two Patch Sets: src/pkg/os/file_windows.go

Issue 127740043: code review 127740043: os: make SameFile handle paths like c:a.txt properly (Closed)
Left Patch Set: diff -r 2cc71cd8fe3e466a2338b1fdf8053931d47a9e31 https://go.googlecode.com/hg/ Created 10 years, 7 months ago
Right Patch Set: diff -r 36cd01e53b35c5df69b32f29d7ea1bd2b4834fb3 https://go.googlecode.com/hg/ Created 10 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/os/os_windows_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package os 5 package os
6 6
7 import ( 7 import (
8 intsyscall "internal/syscall"
9 "io" 8 "io"
10 "runtime" 9 "runtime"
11 "sync" 10 "sync"
12 "syscall" 11 "syscall"
13 "unicode/utf16" 12 "unicode/utf16"
14 "unicode/utf8" 13 "unicode/utf8"
15 "unsafe" 14 "unsafe"
16 ) 15 )
17 16
18 // File represents an open file descriptor. 17 // File represents an open file descriptor.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if e != nil { 110 if e != nil {
112 return nil, e 111 return nil, e
113 } 112 }
114 if fa.FileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY == 0 { 113 if fa.FileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY == 0 {
115 return nil, e 114 return nil, e
116 } 115 }
117 d.isempty = true 116 d.isempty = true
118 } 117 }
119 d.path = name 118 d.path = name
120 if !isAbs(d.path) { 119 if !isAbs(d.path) {
121 » » d.path, e = intsyscall.FullPath(d.path) 120 » » d.path, e = syscall.FullPath(d.path)
122 if e != nil { 121 if e != nil {
123 return nil, e 122 return nil, e
124 } 123 }
125 } 124 }
126 f := newFile(r, name) 125 f := newFile(r, name)
127 f.dirinfo = d 126 f.dirinfo = d
128 return f, nil 127 return f, nil
129 } 128 }
130 129
131 // OpenFile is the generalized open call; most users will use Open 130 // OpenFile is the generalized open call; most users will use Open
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 dir := path[len(vol) : i+1] 586 dir := path[len(vol) : i+1]
588 last := len(dir) - 1 587 last := len(dir) - 1
589 if last > 0 && IsPathSeparator(dir[last]) { 588 if last > 0 && IsPathSeparator(dir[last]) {
590 dir = dir[:last] 589 dir = dir[:last]
591 } 590 }
592 if dir == "" { 591 if dir == "" {
593 dir = "." 592 dir = "."
594 } 593 }
595 return vol + dir 594 return vol + dir
596 } 595 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b