Skip to content

Commit

Permalink
Merge pull request #106 from laraoz/parseRFC3659ListLine-issue
Browse files Browse the repository at this point in the history
parseRFC3659ListLine issue
  • Loading branch information
jlaffaye committed Sep 27, 2017
2 parents 769512c + 090169a commit 299b7ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func parseRFC3659ListLine(line string) (*Entry, error) {
return nil, errUnsupportedListLine
}

key := field[:i]
key := strings.ToLower(field[:i])
value := field[i+1:]

switch key {
Expand Down
2 changes: 2 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var listTests = []line{
{"modify=20150806235817;perm=fle;type=dir;unique=1B20F360U4;UNIX.group=0;UNIX.mode=0755;UNIX.owner=0; movies", "movies", 0, EntryTypeFolder, time.Date(2015, time.August, 6, 23, 58, 17, 0, time.UTC)},
{"modify=20150814172949;perm=flcdmpe;type=dir;unique=85A0C168U4;UNIX.group=0;UNIX.mode=0777;UNIX.owner=0; _upload", "_upload", 0, EntryTypeFolder, time.Date(2015, time.August, 14, 17, 29, 49, 0, time.UTC)},
{"modify=20150813175250;perm=adfr;size=951;type=file;unique=119FBB87UE;UNIX.group=0;UNIX.mode=0644;UNIX.owner=0; welcome.msg", "welcome.msg", 951, EntryTypeFile, time.Date(2015, time.August, 13, 17, 52, 50, 0, time.UTC)},
// Format and types have first letter UpperCase
{"Modify=20150813175250;Perm=adfr;Size=951;Type=file;Unique=119FBB87UE;UNIX.group=0;UNIX.mode=0644;UNIX.owner=0; welcome.msg", "welcome.msg", 951, EntryTypeFile, time.Date(2015, time.August, 13, 17, 52, 50, 0, time.UTC)},

// DOS DIR command output
{"08-07-15 07:50PM 718 Post_PRR_20150901_1166_265118_13049.dat", "Post_PRR_20150901_1166_265118_13049.dat", 718, EntryTypeFile, time.Date(2015, time.August, 7, 19, 50, 0, 0, time.UTC)},
Expand Down

0 comments on commit 299b7ff

Please sign in to comment.