Skip to content

Commit

Permalink
Fixed: when removing a folder, do not delete folders with the same pr…
Browse files Browse the repository at this point in the history
…efix

E.g. Deleting /Photos/* should not delete /Photos2
  • Loading branch information
ItalyPaleAle committed Apr 14, 2020
1 parent f9b364d commit 227fa20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (i *Index) DeleteFile(path string) ([]string, []string, error) {
matchPrefix := false
if strings.HasSuffix(path, "/*") {
matchPrefix = true
path = path[0 : len(path)-2]
path = path[0 : len(path)-1]
} else if strings.HasSuffix(path, "/") {
return nil, nil, errors.New("path cannot end with /; to remove a folder, end with /*")
} else if strings.HasSuffix(path, "*") {
Expand Down

0 comments on commit 227fa20

Please sign in to comment.