Skip to content

Commit

Permalink
convert path to absolute before checking crossing mountpoints
Browse files Browse the repository at this point in the history
fixes #106
  • Loading branch information
dundee committed Nov 23, 2021
1 parent 146589b commit 3b5e3ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/gdu/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ func (a *App) Run() (err error) {
log.Printf("Runtime flags: %+v", *a.Flags)

path := a.getPath()
path, _ = filepath.Abs(path)

ui, err = a.createUI()
if err != nil {
return
Expand Down Expand Up @@ -233,19 +235,17 @@ func (a *App) runAction(ui UI, path string) error {
return fmt.Errorf("reading analysis: %w", err)
}
} else {
abspath, _ := filepath.Abs(path)

if build.RootPathPrefix != "" {
abspath = build.RootPathPrefix + abspath
path = build.RootPathPrefix + path
}

_, err := a.PathChecker(abspath)
_, err := a.PathChecker(path)
if err != nil {
return err
}

log.Printf("Analyzing path: %s", abspath)
if err := ui.AnalyzePath(abspath, nil); err != nil {
log.Printf("Analyzing path: %s", path)
if err := ui.AnalyzePath(path, nil); err != nil {
return fmt.Errorf("scanning dir: %w", err)
}
}
Expand Down

0 comments on commit 3b5e3ee

Please sign in to comment.