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

Unified Diff: src/pkg/os/stat_freebsd.go

Issue 4321045: code review 4321045: os: fix FileInfo.Name returned by Stat
Patch Set: diff -r 90b229dbdd2c https://go.googlecode.com/hg/ Created 14 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/os/stat_darwin.go ('k') | src/pkg/os/stat_linux.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/os/stat_freebsd.go
===================================================================
--- a/src/pkg/os/stat_freebsd.go
+++ b/src/pkg/os/stat_freebsd.go
@@ -24,13 +24,7 @@
fi.Atime_ns = syscall.TimespecToNsec(stat.Atimespec)
fi.Mtime_ns = syscall.TimespecToNsec(stat.Mtimespec)
fi.Ctime_ns = syscall.TimespecToNsec(stat.Ctimespec)
- for i := len(name) - 1; i >= 0; i-- {
- if name[i] == '/' {
- name = name[i+1:]
- break
- }
- }
- fi.Name = name
+ fi.Name = basename(name)
if isSymlink(lstat) && !isSymlink(stat) {
fi.FollowedSymlink = true
}
« no previous file with comments | « src/pkg/os/stat_darwin.go ('k') | src/pkg/os/stat_linux.go » ('j') | no next file with comments »

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