Correctly parse symlink (#152)

fixes #151
This commit is contained in:
Julian Kornberger
2019-06-24 10:49:00 +02:00
committed by Julien Laffaye
parent 9284a88df5
commit c1312a7102
3 changed files with 42 additions and 5 deletions

View File

@@ -135,6 +135,12 @@ func parseLsListLine(line string, now time.Time, loc *time.Location) (*Entry, er
e.Type = EntryTypeFolder
case 'l':
e.Type = EntryTypeLink
// Split link name and target
if i := strings.Index(e.Name, " -> "); i > 0 {
e.Target = e.Name[i+4:]
e.Name = e.Name[:i]
}
default:
return nil, errUnknownListEntryType
}