Skip to content

Commit

Permalink
Merge pull request #169 from xuanduc987/fix/infinite-loop
Browse files Browse the repository at this point in the history
Fix infinite loop in matchRootPath
  • Loading branch information
mattn authored Sep 22, 2021
2 parents cf157c6 + d46a285 commit 6abaff6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions langserver/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,7 @@ func matchRootPath(fname string, markers []string) string {
dir := filepath.Dir(filepath.Clean(fname))
var prev string
for dir != prev {
files, err := ioutil.ReadDir(dir)
if err != nil {
continue
}
files, _ := ioutil.ReadDir(dir)
for _, file := range files {
name := file.Name()
isDir := file.IsDir()
Expand Down

0 comments on commit 6abaff6

Please sign in to comment.