From 8f4c23f1c454a1f5f3e3ca1479227ee5186f8212 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 5 Jul 2024 20:15:03 +0900 Subject: Remove --walker-path-sep Related: #3859 #3907 #3909 --- src/reader.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/reader.go') diff --git a/src/reader.go b/src/reader.go index 9d4fe160..9d4b2f46 100644 --- a/src/reader.go +++ b/src/reader.go @@ -111,7 +111,7 @@ func (r *Reader) readChannel(inputChan chan string) bool { } // ReadSource reads data from the default command or from standard input -func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, ignores []string, sep byte) { +func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, ignores []string) { r.startEventPoller() var success bool if inputChan != nil { @@ -119,7 +119,7 @@ func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, } else if util.IsTty(os.Stdin) { cmd := os.Getenv("FZF_DEFAULT_COMMAND") if len(cmd) == 0 { - success = r.readFiles(root, opts, ignores, sep) + success = r.readFiles(root, opts, ignores) } else { // We can't export FZF_* environment variables to the default command success = r.readFromCommand(cmd, nil) @@ -233,10 +233,9 @@ func isSymlinkToDir(path string, de os.DirEntry) bool { return false } -func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string, sep byte) bool { +func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string) bool { r.killed = false conf := fastwalk.Config{Follow: opts.follow} - replaceSep := sep != os.PathSeparator fn := func(path string, de os.DirEntry, err error) error { if err != nil { return nil @@ -255,15 +254,7 @@ func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string, sep b } } } - bytes := stringBytes(path) - if replaceSep { - for i, b := range bytes { - if b == os.PathSeparator { - bytes[i] = sep - } - } - } - if ((opts.file && !isDir) || (opts.dir && isDir)) && r.pusher(bytes) { + if ((opts.file && !isDir) || (opts.dir && isDir)) && r.pusher(stringBytes(path)) { atomic.StoreInt32(&r.event, int32(EvtReadNew)) } } -- cgit v1.2.3