Skip to content

Commit

Permalink
cli: fix matching of mirror identifiers (fixes #19)
Browse files Browse the repository at this point in the history
Having two given mirrors:
 - test.example.com
 - secondtest.example.com

Matching for test.example.com wasn't possible because the two
identifiers contained the exact same substring.
  • Loading branch information
etix committed Aug 1, 2015
1 parent 2da2ce4 commit eb7310a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands.go
Expand Up @@ -573,6 +573,9 @@ func (c *cli) matchMirror(text string) (list []string, err error) {
}

for _, e := range mirrorsIDs {
if text == e {
return []string{e}, nil
}
if strings.Contains(e, text) {
list = append(list, e)
}
Expand Down

0 comments on commit eb7310a

Please sign in to comment.