Skip to content

Commit

Permalink
Fixed error when removing trailing slash from directory path
Browse files Browse the repository at this point in the history
  • Loading branch information
Hcode00 committed Sep 10, 2024
1 parent b8f5522 commit aabbd1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func (hpaper *Hpaper) StartService() error {
hpaper.List = make([]string, 0, len(files))
u.LOG.Debug("MaxToLoad = " + strconv.Itoa(int(hpaper.MaxToLoad)))
for _, file := range files {
if hpaper.Path[len(hpaper.Path)-1] != '/' {
hpaper.Path += "/"
}
hpaper.List = append(hpaper.List, hpaper.Path+file)
}
go WaitAndSet(hpaper.Interval, hpaper.List, hpaper.MaxToLoad, &hpaper.CurrentIdx)
Expand Down
2 changes: 2 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ func AbsPath(path string) string {
if err != nil {
LOG.Panic("Can't Find Home Directory")
}
LOG.Warn(path[0:])
LOG.Warn(path[1:])
return HOME + path[1:]
}
return path
Expand Down

0 comments on commit aabbd1d

Please sign in to comment.