1 parent
6d1a840587
commit
7174b7e307
4 files changed
+8
-8
No files matched your search
@@ -152,10 +152,10 @@ func (app *app) loop() {
|
||||
|
||||
if gSelect != "" {
|
||||
go func() {
|
||||
stat, err := os.Stat(gSelect)
|
||||
lstat, err := os.Lstat(gSelect)
|
||||
if err != nil {
|
||||
app.ui.exprChan <- &callExpr{"echoerr", []string{err.Error()}, 1}
|
||||
} else if stat.IsDir() {
|
||||
} else if lstat.IsDir() {
|
||||
app.ui.exprChan <- &callExpr{"cd", []string{gSelect}, 1}
|
||||
} else {
|
||||
app.ui.exprChan <- &callExpr{"select", []string{gSelect}, 1}
|
||||
|
||||
@@ -86,12 +86,12 @@ func copyAll(srcs []string, dstDir string) (nums chan int64, errs chan error) {
|
||||
for _, src := range srcs {
|
||||
dst := filepath.Join(dstDir, filepath.Base(src))
|
||||
|
||||
_, err := os.Stat(dst)
|
||||
_, err := os.Lstat(dst)
|
||||
if !os.IsNotExist(err) {
|
||||
var newPath string
|
||||
for i := 1; !os.IsNotExist(err); i++ {
|
||||
newPath = fmt.Sprintf("%s.~%d~", dst, i)
|
||||
_, err = os.Stat(newPath)
|
||||
_, err = os.Lstat(newPath)
|
||||
}
|
||||
dst = newPath
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
app.nav.toggle()
|
||||
} else {
|
||||
for _, path := range e.args {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
if _, err := os.Lstat(path); err == nil {
|
||||
app.nav.toggleSelection(path)
|
||||
} else {
|
||||
log.Printf("toggle: %s", err)
|
||||
|
||||
@@ -379,7 +379,7 @@ func (nav *nav) renew() {
|
||||
}
|
||||
|
||||
for m := range nav.selections {
|
||||
if _, err := os.Stat(m); os.IsNotExist(err) {
|
||||
if _, err := os.Lstat(m); os.IsNotExist(err) {
|
||||
delete(nav.selections, m)
|
||||
}
|
||||
}
|
||||
@@ -732,7 +732,7 @@ func (nav *nav) moveAsync(ui *ui, srcs []string, dstDir string) {
|
||||
var newPath string
|
||||
for i := 1; !os.IsNotExist(err); i++ {
|
||||
newPath = fmt.Sprintf("%s.~%d~", dst, i)
|
||||
_, err = os.Stat(newPath)
|
||||
_, err = os.Lstat(newPath)
|
||||
}
|
||||
dst = newPath
|
||||
}
|
||||
@@ -914,7 +914,7 @@ func (nav *nav) sel(path string) error {
|
||||
path = replaceTilde(path)
|
||||
path = filepath.Clean(path)
|
||||
|
||||
lstat, err := os.Stat(path)
|
||||
lstat, err := os.Lstat(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("select: %s", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user